@aws-amplify/ui-react 2.15.8 → 2.16.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/components/Authenticator/Authenticator.js +1 -1
- package/dist/esm/components/Authenticator/ConfirmSignIn/ConfirmSignIn.js +1 -1
- package/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.js +1 -1
- package/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.js +1 -1
- package/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.js +1 -1
- package/dist/esm/components/Authenticator/ResetPassword/ResetPassword.js +1 -1
- package/dist/esm/components/Authenticator/RouteContainer/RouteContainer.js +1 -0
- package/dist/esm/components/Authenticator/Router/Router.js +1 -0
- package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.js +1 -1
- package/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.js +1 -1
- package/dist/esm/components/Authenticator/VerifyUser/VerifyUser.js +1 -1
- package/dist/esm/components/Authenticator/hooks/useCustomComponents/index.js +1 -1
- package/dist/esm/components/Authenticator/shared/SignInSignUpTabs.js +1 -1
- package/dist/esm/components/Authenticator/utils.js +1 -0
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Authenticator/Authenticator.d.ts +8 -10
- package/dist/types/components/Authenticator/ConfirmSignIn/ConfirmSignIn.d.ts +2 -1
- package/dist/types/components/Authenticator/ConfirmSignUp/ConfirmSignUp.d.ts +2 -1
- package/dist/types/components/Authenticator/ForceNewPassword/ForceNewPassword.d.ts +2 -1
- package/dist/types/components/Authenticator/ResetPassword/ConfirmResetPassword.d.ts +2 -1
- package/dist/types/components/Authenticator/ResetPassword/ResetPassword.d.ts +2 -1
- package/dist/types/components/Authenticator/RouteContainer/RouteContainer.d.ts +3 -0
- package/dist/types/components/Authenticator/RouteContainer/index.d.ts +2 -0
- package/dist/types/components/Authenticator/RouteContainer/types.d.ts +8 -0
- package/dist/types/components/Authenticator/Router/Router.d.ts +4 -0
- package/dist/types/components/Authenticator/Router/index.d.ts +3 -15
- package/dist/types/components/Authenticator/Router/types.d.ts +11 -0
- package/dist/types/components/Authenticator/SetupTOTP/SetupTOTP.d.ts +2 -1
- package/dist/types/components/Authenticator/VerifyUser/ConfirmVerifyUser.d.ts +2 -1
- package/dist/types/components/Authenticator/VerifyUser/VerifyUser.d.ts +2 -1
- package/dist/types/components/Authenticator/hooks/useAuthenticator/index.d.ts +4 -2
- package/dist/types/components/Authenticator/shared/SignInSignUpTabs.d.ts +3 -2
- package/dist/types/components/Authenticator/utils.d.ts +1 -0
- package/package.json +15 -7
- package/dist/esm/components/Authenticator/Router/index.js +0 -1
package/dist/styles.css
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { AuthenticatorMachineOptions } from '@aws-amplify/ui';
|
|
3
|
-
import { RouterProps } from './Router';
|
|
4
3
|
import { ComponentsProviderProps } from './hooks/useCustomComponents';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
export declare function Authenticator({ children, className, components: customComponents, initialState, loginMechanisms, services, signUpAttributes, socialProviders, variation, hideSignUp, formFields, }: AuthenticatorProps): JSX.Element;
|
|
4
|
+
import { RouterProps } from './Router';
|
|
5
|
+
export declare type AuthenticatorProps = Partial<AuthenticatorMachineOptions & ComponentsProviderProps & RouterProps>;
|
|
6
|
+
export declare function Authenticator({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): JSX.Element;
|
|
9
7
|
export declare namespace Authenticator {
|
|
10
8
|
var Provider: ({ children }: {
|
|
11
|
-
children:
|
|
9
|
+
children: React.ReactNode;
|
|
12
10
|
}) => JSX.Element;
|
|
13
11
|
var ResetPassword: {
|
|
14
|
-
(): JSX.Element;
|
|
12
|
+
({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
|
|
15
13
|
Header(): JSX.Element;
|
|
16
14
|
Footer(): JSX.Element;
|
|
17
15
|
};
|
|
18
16
|
var SetupTOTP: {
|
|
19
|
-
(): JSX.Element;
|
|
17
|
+
({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
|
|
20
18
|
Header(): JSX.Element;
|
|
21
19
|
Footer(): JSX.Element;
|
|
22
20
|
};
|
|
23
21
|
var SignIn: typeof import("./SignIn").SignIn;
|
|
24
22
|
var SignUp: typeof import("./SignUp").SignUp;
|
|
25
23
|
var ForceNewPassword: {
|
|
26
|
-
(): JSX.Element;
|
|
24
|
+
({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
|
|
27
25
|
FormFields(): JSX.Element;
|
|
28
26
|
};
|
|
29
27
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { RouteProps } from '../RouteContainer';
|
|
3
|
+
export declare function ConfirmSignUp({ className, variation }: RouteProps): JSX.Element;
|
|
3
4
|
export declare namespace ConfirmSignUp {
|
|
4
5
|
var Header: () => JSX.Element;
|
|
5
6
|
var Footer: () => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RouterProps } from './types';
|
|
3
|
+
export declare function useRouterChildren(children: RouterProps['children']): (props?: Omit<RouterProps, 'children'>) => JSX.Element;
|
|
4
|
+
export declare function Router({ children, className, hideSignUp, variation, }: RouterProps): JSX.Element;
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare type AuthenticatorChildren = React.ReactNode | (({ signOut, user, }: {
|
|
5
|
-
signOut?: ReturnType<typeof useAuthenticator>['signOut'];
|
|
6
|
-
user?: CognitoUserAmplify;
|
|
7
|
-
}) => React.ReactNode);
|
|
8
|
-
export declare type RouterProps = {
|
|
9
|
-
className?: string;
|
|
10
|
-
children?: AuthenticatorChildren;
|
|
11
|
-
variation?: 'default' | 'modal';
|
|
12
|
-
hideSignUp?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare function Router({ children, className, variation, hideSignUp, }: RouterProps): JSX.Element;
|
|
15
|
-
export {};
|
|
1
|
+
export { RouteContainer } from '../RouteContainer/RouteContainer';
|
|
2
|
+
export { Router } from './Router';
|
|
3
|
+
export { RouterProps } from './types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CognitoUserAmplify } from '@aws-amplify/ui';
|
|
3
|
+
import { RouteProps } from '../RouteContainer';
|
|
4
|
+
import { UseAuthenticator } from '../hooks/useAuthenticator';
|
|
5
|
+
export declare type RouterProps = {
|
|
6
|
+
children: React.ReactNode | ((props?: {
|
|
7
|
+
signOut?: UseAuthenticator['signOut'];
|
|
8
|
+
user?: CognitoUserAmplify;
|
|
9
|
+
}) => React.ReactNode);
|
|
10
|
+
hideSignUp: boolean;
|
|
11
|
+
} & RouteProps;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { RouteProps } from '../RouteContainer';
|
|
2
3
|
export declare const getTotpCode: (issuer: string, username: string, secret: string) => string;
|
|
3
4
|
export declare const SetupTOTP: {
|
|
4
|
-
(): JSX.Element;
|
|
5
|
+
({ className, variation, }: RouteProps): JSX.Element;
|
|
5
6
|
Header(): JSX.Element;
|
|
6
7
|
Footer(): JSX.Element;
|
|
7
8
|
};
|
|
@@ -11,7 +11,7 @@ export declare type AuthenticatorContextValue = {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const AuthenticatorContext: React.Context<AuthenticatorContextValue>;
|
|
13
13
|
export declare const Provider: ({ children }: {
|
|
14
|
-
children:
|
|
14
|
+
children: React.ReactNode;
|
|
15
15
|
}) => JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* These are the "facades" that we provide, which contains contexts respective
|
|
@@ -38,11 +38,12 @@ export declare const useAuthenticator: (selector?: Selector) => {
|
|
|
38
38
|
/** @deprecated For internal use only */
|
|
39
39
|
_state: import("xstate").State<import("@aws-amplify/ui").AuthContext, import("@aws-amplify/ui").AuthEvent, any, any, any>;
|
|
40
40
|
/** @deprecated For internal use only */
|
|
41
|
-
_send: (event: import("xstate").
|
|
41
|
+
_send: (event: import("xstate").SingleOrArray<import("xstate").Event<import("@aws-amplify/ui").AuthEvent>> | import("xstate").SCXML.Event<import("@aws-amplify/ui").AuthEvent>, payload?: import("xstate").EventData) => import("xstate").State<import("@aws-amplify/ui").AuthContext, import("@aws-amplify/ui").AuthEvent, any, any, any>;
|
|
42
42
|
error: string;
|
|
43
43
|
hasValidationErrors: boolean;
|
|
44
44
|
isPending: boolean;
|
|
45
45
|
route: string;
|
|
46
|
+
authStatus: string;
|
|
46
47
|
user: import("@aws-amplify/ui").CognitoUserAmplify;
|
|
47
48
|
validationErrors: {
|
|
48
49
|
[x: string]: string | string[];
|
|
@@ -59,3 +60,4 @@ export declare const useAuthenticator: (selector?: Selector) => {
|
|
|
59
60
|
toSignUp: (data?: import("@aws-amplify/ui").AuthEventData) => void;
|
|
60
61
|
skipVerification: (data?: import("@aws-amplify/ui").AuthEventData) => void;
|
|
61
62
|
};
|
|
63
|
+
export declare type UseAuthenticator = ReturnType<typeof useAuthenticator>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { RouteProps } from '../RouteContainer';
|
|
3
|
+
export declare const SignInSignUpTabs: ({ className, hideSignUp, variation, }: {
|
|
3
4
|
hideSignUp: boolean;
|
|
4
|
-
}) => JSX.Element;
|
|
5
|
+
} & RouteProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isSignInOrSignUpRoute: (route: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"build:icons": "yarn run clean:icons && node scripts/generateIcons.js",
|
|
51
51
|
"clean": "rimraf dist node_modules",
|
|
52
52
|
"clean:icons": "rimraf ./src/primitives/Icon/icons",
|
|
53
|
-
"lint": "tsc --noEmit && yarn eslint ./src --ext .js,.ts,.tsx",
|
|
53
|
+
"lint": "tsc --noEmit --project tsconfig.dev.json && yarn eslint ./src --ext .js,.ts,.tsx",
|
|
54
54
|
"test": "yarn test:unit",
|
|
55
55
|
"test:watch": "yarn test:unit:watch",
|
|
56
56
|
"test:unit": "jest",
|
|
57
57
|
"test:unit:watch": "jest --watch"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@aws-amplify/ui": "3.
|
|
60
|
+
"@aws-amplify/ui": "3.7.0",
|
|
61
61
|
"@aws-amplify/ui-react-v1": "npm:@aws-amplify/ui-react@1.2.9",
|
|
62
62
|
"@radix-ui/react-accordion": "0.1.6",
|
|
63
63
|
"@radix-ui/react-dropdown-menu": "0.1.6",
|
|
@@ -94,11 +94,19 @@
|
|
|
94
94
|
"@types/jest": "^26.0.23",
|
|
95
95
|
"@types/qrcode": "^1.4.2",
|
|
96
96
|
"@types/testing-library__jest-dom": "^5.14.1",
|
|
97
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
98
|
-
"@typescript-eslint/parser": "^5.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
98
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
99
99
|
"degit": "^2.8.4",
|
|
100
|
-
"eslint": "^8.
|
|
101
|
-
"eslint-
|
|
100
|
+
"eslint": "^8.13.0",
|
|
101
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
102
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
103
|
+
"eslint-config-prettier": "^8.5.0",
|
|
104
|
+
"eslint-plugin-import": "^2.26.0",
|
|
105
|
+
"eslint-plugin-jest": "^26.1.4",
|
|
106
|
+
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
107
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
108
|
+
"eslint-plugin-react": "^7.29.4",
|
|
109
|
+
"eslint-plugin-react-hooks": "^4.4.0",
|
|
102
110
|
"jest": "^27.0.4",
|
|
103
111
|
"jest-matchmedia-mock": "^1.1.0",
|
|
104
112
|
"react-router-dom": "^6.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r,Fragment as e,jsxs as i}from"react/jsx-runtime";import{useAuthenticator as s}from"../hooks/useAuthenticator/index.js";import{View as t}from"../../../primitives/View/View.js";import{ConfirmSignUp as n}from"../ConfirmSignUp/ConfirmSignUp.js";import{ForceNewPassword as o}from"../ForceNewPassword/ForceNewPassword.js";import{useCustomComponents as a}from"../hooks/useCustomComponents/index.js";import{SetupTOTP as m}from"../SetupTOTP/SetupTOTP.js";import"@aws-amplify/ui";import"../../../primitives/TextField/TextField.js";import"../../../primitives/Button/Button.js";import"../../../primitives/Flex/Flex.js";import"../../../primitives/Alert/Alert.js";import{SignInSignUpTabs as u}from"../shared/SignInSignUpTabs.js";import{ConfirmVerifyUser as p}from"../VerifyUser/ConfirmVerifyUser.js";import{VerifyUser as c}from"../VerifyUser/VerifyUser.js";import{ConfirmSignIn as f}from"../ConfirmSignIn/ConfirmSignIn.js";import{ConfirmResetPassword as d}from"../ResetPassword/ConfirmResetPassword.js";import{ResetPassword as l}from"../ResetPassword/ResetPassword.js";const g=r=>"signIn"===r||"signUp";function j({children:j,className:h,variation:w="default",hideSignUp:U}){const{route:y,signOut:P,user:S}=s((r=>[r.route,r.signOut,r.user])),{components:{Header:O,Footer:v}}=a();return["authenticated","signOut"].includes(y)?j?r(e,{children:"function"==typeof j?j({signOut:P,user:S}):j}):null:r(e,{children:r(t,Object.assign({className:h,"data-amplify-authenticator":"","data-variation":w},{children:i(t,Object.assign({"data-amplify-container":""},{children:[r(O,{}),r(t,Object.assign({"data-amplify-router":"","data-amplify-router-content":g(y)?void 0:""},{children:(()=>{switch(y){case"idle":case"setup":return null;case"confirmSignUp":return r(n,{});case"confirmSignIn":return r(f,{});case"setupTOTP":return r(m,{});case"signIn":case"signUp":return r(u,{hideSignUp:U});case"forceNewPassword":return r(o,{});case"resetPassword":return r(l,{});case"confirmResetPassword":return r(d,{});case"verifyUser":return r(c,{});case"confirmVerifyUser":return r(p,{});default:return console.warn("Unhandled Authenicator route – please open an issue: ",y),null}})()})),r(v,{})]}))}))})}export{j as Router};
|