@ttoss/react-auth-core 0.2.54 → 0.2.56

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/index.d.cts DELETED
@@ -1,174 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
-
4
- type LogoContextProps = {
5
- logo?: React$1.ReactNode;
6
- children?: React$1.ReactNode;
7
- };
8
-
9
- type AuthUser = {
10
- id: string;
11
- email: string;
12
- emailVerified?: boolean;
13
- };
14
- type AuthTokens = {
15
- accessToken: string;
16
- refreshToken?: string;
17
- idToken?: string;
18
- expiresIn?: number;
19
- expiresAt?: number;
20
- };
21
- type AuthData = {
22
- user: AuthUser | null;
23
- tokens: AuthTokens | null;
24
- isAuthenticated: boolean | undefined;
25
- };
26
- type AuthContextValue = {
27
- signOut: () => Promise<void>;
28
- isAuthenticated: boolean;
29
- user: AuthUser | null;
30
- tokens: AuthTokens | null;
31
- setAuthData: React.Dispatch<React.SetStateAction<AuthData>>;
32
- };
33
- type AuthScreen = {
34
- value: 'signIn';
35
- } | {
36
- value: 'signUp';
37
- } | {
38
- value: 'confirmSignUpWithCode';
39
- context: {
40
- email: string;
41
- };
42
- } | {
43
- value: 'confirmSignUpCheckEmail';
44
- } | {
45
- value: 'forgotPassword';
46
- } | {
47
- value: 'confirmResetPassword';
48
- context: {
49
- email: string;
50
- };
51
- };
52
- type OnSignInInput = {
53
- email: string;
54
- password: string;
55
- };
56
- type OnSignUpInput = {
57
- email: string;
58
- password: string;
59
- confirmPassword: string;
60
- signUpTerms?: boolean;
61
- };
62
- type OnConfirmSignUpWithCodeInput = {
63
- email: string;
64
- code: string;
65
- };
66
- type OnForgotPasswordInput = {
67
- email: string;
68
- };
69
- type OnForgotPasswordResetPasswordInput = {
70
- email: string;
71
- code: string;
72
- newPassword: string;
73
- };
74
- type OnSignIn = (input: OnSignInInput) => Promise<void> | void;
75
- type OnSignUp = (input: OnSignUpInput) => Promise<void> | void;
76
- type OnConfirmSignUpCheckEmail = () => Promise<void> | void;
77
- type OnConfirmSignUpWithCode = (input: OnConfirmSignUpWithCodeInput) => Promise<void> | void;
78
- type OnForgotPassword = (input: OnForgotPasswordInput) => Promise<void> | void;
79
- type OnForgotPasswordResetPassword = (input: OnForgotPasswordResetPasswordInput) => Promise<void> | void;
80
- type SignUpTerms = {
81
- isRequired: boolean;
82
- terms: {
83
- label: string;
84
- url: string;
85
- }[];
86
- };
87
-
88
- type AuthLogicProps = {
89
- screen: AuthScreen;
90
- setScreen: (screen: AuthScreen) => void;
91
- signUpTerms?: SignUpTerms;
92
- passwordMinimumLength?: number;
93
- onSignIn: OnSignIn;
94
- onSignUp?: OnSignUp;
95
- onConfirmSignUpCheckEmail?: OnConfirmSignUpCheckEmail;
96
- onConfirmSignUpWithCode?: OnConfirmSignUpWithCode;
97
- onForgotPassword?: OnForgotPassword;
98
- onForgotPasswordResetPassword?: OnForgotPasswordResetPassword;
99
- };
100
- type AuthLayout = {
101
- fullScreen?: boolean;
102
- sideContent?: React$1.ReactNode;
103
- sideContentPosition?: 'left' | 'right';
104
- };
105
- type AuthProps = LogoContextProps & AuthLogicProps & {
106
- layout?: AuthLayout;
107
- };
108
- declare const Auth: (props: AuthProps) => react_jsx_runtime.JSX.Element;
109
-
110
- type AuthConfirmSignUpCheckEmailProps = {
111
- onConfirmSignUpCheckEmail: OnConfirmSignUpCheckEmail;
112
- };
113
- declare const AuthConfirmSignUpCheckEmail: ({ onConfirmSignUpCheckEmail, }: AuthConfirmSignUpCheckEmailProps) => react_jsx_runtime.JSX.Element;
114
-
115
- type AuthConfirmSignUpWithCodeProps = {
116
- email: string;
117
- onConfirmSignUpWithCode: OnConfirmSignUpWithCode;
118
- };
119
- declare const AuthConfirmSignUpWithCode: ({ email, onConfirmSignUpWithCode, }: AuthConfirmSignUpWithCodeProps) => react_jsx_runtime.JSX.Element;
120
-
121
- type AuthForgotPasswordProps = {
122
- onForgotPassword: OnForgotPassword;
123
- onGoToSignIn: () => void;
124
- onGoToSignUp?: () => void;
125
- };
126
- declare const AuthForgotPassword: (props: AuthForgotPasswordProps) => react_jsx_runtime.JSX.Element;
127
-
128
- type AuthForgotPasswordResetPasswordProps = {
129
- email: string;
130
- onForgotPasswordResetPassword: OnForgotPasswordResetPassword;
131
- onGoToSignIn: () => void;
132
- passwordMinimumLength?: number;
133
- };
134
- declare const AuthForgotPasswordResetPassword: (props: AuthForgotPasswordResetPasswordProps) => react_jsx_runtime.JSX.Element;
135
-
136
- type AuthFullScreenProps = {
137
- backgroundImageUrl?: string;
138
- children: React.ReactNode;
139
- };
140
- declare const AuthFullScreen: ({ children }: AuthFullScreenProps) => react_jsx_runtime.JSX.Element;
141
-
142
- type AuthProviderProps = {
143
- children: React$1.ReactNode;
144
- getAuthData: () => Promise<AuthData | null>;
145
- signOut: () => Promise<void>;
146
- };
147
- declare const AuthProvider: (props: AuthProviderProps) => react_jsx_runtime.JSX.Element | null;
148
- declare const useAuth: () => AuthContextValue;
149
-
150
- type AuthSignInProps = {
151
- onSignIn: OnSignIn;
152
- onGoToSignUp?: () => void;
153
- onGoToForgotPassword?: () => void;
154
- defaultValues?: Partial<OnSignInInput>;
155
- passwordMinimumLength?: number;
156
- };
157
- declare const AuthSignIn: ({ onSignIn, onGoToSignUp, defaultValues, onGoToForgotPassword, passwordMinimumLength, }: AuthSignInProps) => react_jsx_runtime.JSX.Element;
158
-
159
- type AuthSignUpProps = {
160
- onSignUp: OnSignUp;
161
- onGoToSignIn: () => void;
162
- signUpTerms?: SignUpTerms;
163
- passwordMinimumLength?: number;
164
- };
165
- declare const AuthSignUp: (props: AuthSignUpProps) => react_jsx_runtime.JSX.Element;
166
-
167
- declare const ErrorBoundary: ({ children }: React$1.PropsWithChildren) => react_jsx_runtime.JSX.Element;
168
-
169
- declare const useAuthScreen: (initialScreen?: AuthScreen) => {
170
- screen: AuthScreen;
171
- setScreen: React$1.Dispatch<React$1.SetStateAction<AuthScreen>>;
172
- };
173
-
174
- export { Auth, AuthConfirmSignUpCheckEmail, type AuthConfirmSignUpCheckEmailProps, AuthConfirmSignUpWithCode, type AuthConfirmSignUpWithCodeProps, type AuthContextValue, type AuthData, AuthForgotPassword, type AuthForgotPasswordProps, AuthForgotPasswordResetPassword, type AuthForgotPasswordResetPasswordProps, AuthFullScreen, type AuthFullScreenProps, type AuthProps, AuthProvider, type AuthProviderProps, type AuthScreen, AuthSignIn, type AuthSignInProps, AuthSignUp, type AuthSignUpProps, type AuthTokens, type AuthUser, ErrorBoundary, type OnConfirmSignUpCheckEmail, type OnConfirmSignUpWithCode, type OnConfirmSignUpWithCodeInput, type OnForgotPassword, type OnForgotPasswordInput, type OnForgotPasswordResetPassword, type OnForgotPasswordResetPasswordInput, type OnSignIn, type OnSignInInput, type OnSignUp, type OnSignUpInput, type SignUpTerms, useAuth, useAuthScreen };
package/dist/index.d.ts DELETED
@@ -1,174 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
-
4
- type LogoContextProps = {
5
- logo?: React$1.ReactNode;
6
- children?: React$1.ReactNode;
7
- };
8
-
9
- type AuthUser = {
10
- id: string;
11
- email: string;
12
- emailVerified?: boolean;
13
- };
14
- type AuthTokens = {
15
- accessToken: string;
16
- refreshToken?: string;
17
- idToken?: string;
18
- expiresIn?: number;
19
- expiresAt?: number;
20
- };
21
- type AuthData = {
22
- user: AuthUser | null;
23
- tokens: AuthTokens | null;
24
- isAuthenticated: boolean | undefined;
25
- };
26
- type AuthContextValue = {
27
- signOut: () => Promise<void>;
28
- isAuthenticated: boolean;
29
- user: AuthUser | null;
30
- tokens: AuthTokens | null;
31
- setAuthData: React.Dispatch<React.SetStateAction<AuthData>>;
32
- };
33
- type AuthScreen = {
34
- value: 'signIn';
35
- } | {
36
- value: 'signUp';
37
- } | {
38
- value: 'confirmSignUpWithCode';
39
- context: {
40
- email: string;
41
- };
42
- } | {
43
- value: 'confirmSignUpCheckEmail';
44
- } | {
45
- value: 'forgotPassword';
46
- } | {
47
- value: 'confirmResetPassword';
48
- context: {
49
- email: string;
50
- };
51
- };
52
- type OnSignInInput = {
53
- email: string;
54
- password: string;
55
- };
56
- type OnSignUpInput = {
57
- email: string;
58
- password: string;
59
- confirmPassword: string;
60
- signUpTerms?: boolean;
61
- };
62
- type OnConfirmSignUpWithCodeInput = {
63
- email: string;
64
- code: string;
65
- };
66
- type OnForgotPasswordInput = {
67
- email: string;
68
- };
69
- type OnForgotPasswordResetPasswordInput = {
70
- email: string;
71
- code: string;
72
- newPassword: string;
73
- };
74
- type OnSignIn = (input: OnSignInInput) => Promise<void> | void;
75
- type OnSignUp = (input: OnSignUpInput) => Promise<void> | void;
76
- type OnConfirmSignUpCheckEmail = () => Promise<void> | void;
77
- type OnConfirmSignUpWithCode = (input: OnConfirmSignUpWithCodeInput) => Promise<void> | void;
78
- type OnForgotPassword = (input: OnForgotPasswordInput) => Promise<void> | void;
79
- type OnForgotPasswordResetPassword = (input: OnForgotPasswordResetPasswordInput) => Promise<void> | void;
80
- type SignUpTerms = {
81
- isRequired: boolean;
82
- terms: {
83
- label: string;
84
- url: string;
85
- }[];
86
- };
87
-
88
- type AuthLogicProps = {
89
- screen: AuthScreen;
90
- setScreen: (screen: AuthScreen) => void;
91
- signUpTerms?: SignUpTerms;
92
- passwordMinimumLength?: number;
93
- onSignIn: OnSignIn;
94
- onSignUp?: OnSignUp;
95
- onConfirmSignUpCheckEmail?: OnConfirmSignUpCheckEmail;
96
- onConfirmSignUpWithCode?: OnConfirmSignUpWithCode;
97
- onForgotPassword?: OnForgotPassword;
98
- onForgotPasswordResetPassword?: OnForgotPasswordResetPassword;
99
- };
100
- type AuthLayout = {
101
- fullScreen?: boolean;
102
- sideContent?: React$1.ReactNode;
103
- sideContentPosition?: 'left' | 'right';
104
- };
105
- type AuthProps = LogoContextProps & AuthLogicProps & {
106
- layout?: AuthLayout;
107
- };
108
- declare const Auth: (props: AuthProps) => react_jsx_runtime.JSX.Element;
109
-
110
- type AuthConfirmSignUpCheckEmailProps = {
111
- onConfirmSignUpCheckEmail: OnConfirmSignUpCheckEmail;
112
- };
113
- declare const AuthConfirmSignUpCheckEmail: ({ onConfirmSignUpCheckEmail, }: AuthConfirmSignUpCheckEmailProps) => react_jsx_runtime.JSX.Element;
114
-
115
- type AuthConfirmSignUpWithCodeProps = {
116
- email: string;
117
- onConfirmSignUpWithCode: OnConfirmSignUpWithCode;
118
- };
119
- declare const AuthConfirmSignUpWithCode: ({ email, onConfirmSignUpWithCode, }: AuthConfirmSignUpWithCodeProps) => react_jsx_runtime.JSX.Element;
120
-
121
- type AuthForgotPasswordProps = {
122
- onForgotPassword: OnForgotPassword;
123
- onGoToSignIn: () => void;
124
- onGoToSignUp?: () => void;
125
- };
126
- declare const AuthForgotPassword: (props: AuthForgotPasswordProps) => react_jsx_runtime.JSX.Element;
127
-
128
- type AuthForgotPasswordResetPasswordProps = {
129
- email: string;
130
- onForgotPasswordResetPassword: OnForgotPasswordResetPassword;
131
- onGoToSignIn: () => void;
132
- passwordMinimumLength?: number;
133
- };
134
- declare const AuthForgotPasswordResetPassword: (props: AuthForgotPasswordResetPasswordProps) => react_jsx_runtime.JSX.Element;
135
-
136
- type AuthFullScreenProps = {
137
- backgroundImageUrl?: string;
138
- children: React.ReactNode;
139
- };
140
- declare const AuthFullScreen: ({ children }: AuthFullScreenProps) => react_jsx_runtime.JSX.Element;
141
-
142
- type AuthProviderProps = {
143
- children: React$1.ReactNode;
144
- getAuthData: () => Promise<AuthData | null>;
145
- signOut: () => Promise<void>;
146
- };
147
- declare const AuthProvider: (props: AuthProviderProps) => react_jsx_runtime.JSX.Element | null;
148
- declare const useAuth: () => AuthContextValue;
149
-
150
- type AuthSignInProps = {
151
- onSignIn: OnSignIn;
152
- onGoToSignUp?: () => void;
153
- onGoToForgotPassword?: () => void;
154
- defaultValues?: Partial<OnSignInInput>;
155
- passwordMinimumLength?: number;
156
- };
157
- declare const AuthSignIn: ({ onSignIn, onGoToSignUp, defaultValues, onGoToForgotPassword, passwordMinimumLength, }: AuthSignInProps) => react_jsx_runtime.JSX.Element;
158
-
159
- type AuthSignUpProps = {
160
- onSignUp: OnSignUp;
161
- onGoToSignIn: () => void;
162
- signUpTerms?: SignUpTerms;
163
- passwordMinimumLength?: number;
164
- };
165
- declare const AuthSignUp: (props: AuthSignUpProps) => react_jsx_runtime.JSX.Element;
166
-
167
- declare const ErrorBoundary: ({ children }: React$1.PropsWithChildren) => react_jsx_runtime.JSX.Element;
168
-
169
- declare const useAuthScreen: (initialScreen?: AuthScreen) => {
170
- screen: AuthScreen;
171
- setScreen: React$1.Dispatch<React$1.SetStateAction<AuthScreen>>;
172
- };
173
-
174
- export { Auth, AuthConfirmSignUpCheckEmail, type AuthConfirmSignUpCheckEmailProps, AuthConfirmSignUpWithCode, type AuthConfirmSignUpWithCodeProps, type AuthContextValue, type AuthData, AuthForgotPassword, type AuthForgotPasswordProps, AuthForgotPasswordResetPassword, type AuthForgotPasswordResetPasswordProps, AuthFullScreen, type AuthFullScreenProps, type AuthProps, AuthProvider, type AuthProviderProps, type AuthScreen, AuthSignIn, type AuthSignInProps, AuthSignUp, type AuthSignUpProps, type AuthTokens, type AuthUser, ErrorBoundary, type OnConfirmSignUpCheckEmail, type OnConfirmSignUpWithCode, type OnConfirmSignUpWithCodeInput, type OnForgotPassword, type OnForgotPasswordInput, type OnForgotPasswordResetPassword, type OnForgotPasswordResetPasswordInput, type OnSignIn, type OnSignInInput, type OnSignUp, type OnSignUpInput, type SignUpTerms, useAuth, useAuthScreen };