@insforge/react 0.3.5 → 0.4.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/README.md +485 -604
- package/dist/atoms.cjs +818 -0
- package/dist/atoms.cjs.map +1 -0
- package/dist/atoms.d.cts +222 -0
- package/dist/atoms.d.ts +72 -237
- package/dist/atoms.js +382 -456
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +2254 -0
- package/dist/components.cjs.map +1 -0
- package/dist/{components.d.mts → components.d.cts} +10 -32
- package/dist/components.d.ts +9 -31
- package/dist/components.js +1046 -1180
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +1287 -0
- package/dist/forms.cjs.map +1 -0
- package/dist/forms.d.cts +138 -0
- package/dist/forms.d.ts +115 -162
- package/dist/forms.js +728 -921
- package/dist/forms.js.map +1 -1
- package/dist/{hooks.mjs → hooks.cjs} +15 -13
- package/dist/hooks.cjs.map +1 -0
- package/dist/{hooks.d.mts → hooks.d.cts} +1 -1
- package/dist/hooks.js +9 -15
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +2674 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +10 -10
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1093 -1235
- package/dist/index.js.map +1 -1
- package/dist/{lib.mjs → lib.cjs} +13 -11
- package/dist/lib.cjs.map +1 -0
- package/dist/{lib.d.mts → lib.d.cts} +1 -8
- package/dist/lib.d.ts +1 -8
- package/dist/lib.js +4 -17
- package/dist/lib.js.map +1 -1
- package/dist/{router.mjs → router.cjs} +14 -16
- package/dist/router.cjs.map +1 -0
- package/dist/router.js +10 -16
- package/dist/router.js.map +1 -1
- package/dist/styles.css +655 -2
- package/dist/types.cjs +4 -0
- package/dist/{types.mjs.map → types.cjs.map} +1 -1
- package/dist/{types.d.mts → types.d.cts} +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +0 -1
- package/package.json +106 -98
- package/dist/atoms.d.mts +0 -387
- package/dist/atoms.mjs +0 -861
- package/dist/atoms.mjs.map +0 -1
- package/dist/components.mjs +0 -2327
- package/dist/components.mjs.map +0 -1
- package/dist/forms.d.mts +0 -185
- package/dist/forms.mjs +0 -1468
- package/dist/forms.mjs.map +0 -1
- package/dist/hooks.mjs.map +0 -1
- package/dist/index.mjs +0 -2724
- package/dist/index.mjs.map +0 -1
- package/dist/lib.mjs.map +0 -1
- package/dist/router.mjs.map +0 -1
- package/dist/types.mjs +0 -3
- package/src/styles.css +0 -15
- /package/dist/{router.d.mts → router.d.cts} +0 -0
package/dist/forms.d.mts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SignInFormProps, SignUpFormProps, ForgotPasswordFormProps, ResetPasswordFormProps, VerifyEmailStatusProps } from './types.mjs';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '@insforge/shared-schemas';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Pre-built sign-in form component (UI only, no business logic).
|
|
8
|
-
*
|
|
9
|
-
* @component
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* const [email, setEmail] = useState('');
|
|
13
|
-
* const [password, setPassword] = useState('');
|
|
14
|
-
* const [error, setError] = useState('');
|
|
15
|
-
* const [loading, setLoading] = useState(false);
|
|
16
|
-
*
|
|
17
|
-
* const handleSubmit = async (e) => {
|
|
18
|
-
* e.preventDefault();
|
|
19
|
-
* setLoading(true);
|
|
20
|
-
* try {
|
|
21
|
-
* await authService.signIn(email, password);
|
|
22
|
-
* } catch (err) {
|
|
23
|
-
* setError(err.message);
|
|
24
|
-
* } finally {
|
|
25
|
-
* setLoading(false);
|
|
26
|
-
* }
|
|
27
|
-
* };
|
|
28
|
-
*
|
|
29
|
-
* <SignInForm
|
|
30
|
-
* email={email}
|
|
31
|
-
* password={password}
|
|
32
|
-
* onEmailChange={setEmail}
|
|
33
|
-
* onPasswordChange={setPassword}
|
|
34
|
-
* onSubmit={handleSubmit}
|
|
35
|
-
* error={error}
|
|
36
|
-
* loading={loading}
|
|
37
|
-
* />
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, authConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Pre-built sign-up form component (UI only, no business logic).
|
|
44
|
-
*
|
|
45
|
-
* @component
|
|
46
|
-
* @example
|
|
47
|
-
* ```tsx
|
|
48
|
-
* const [email, setEmail] = useState('');
|
|
49
|
-
* const [password, setPassword] = useState('');
|
|
50
|
-
* const [error, setError] = useState('');
|
|
51
|
-
* const [loading, setLoading] = useState(false);
|
|
52
|
-
*
|
|
53
|
-
* const handleSubmit = async (e) => {
|
|
54
|
-
* e.preventDefault();
|
|
55
|
-
* setLoading(true);
|
|
56
|
-
* try {
|
|
57
|
-
* await authService.signUp(email, password);
|
|
58
|
-
* } catch (err) {
|
|
59
|
-
* setError(err.message);
|
|
60
|
-
* } finally {
|
|
61
|
-
* setLoading(false);
|
|
62
|
-
* }
|
|
63
|
-
* };
|
|
64
|
-
*
|
|
65
|
-
* <SignUpForm
|
|
66
|
-
* email={email}
|
|
67
|
-
* password={password}
|
|
68
|
-
* onEmailChange={setEmail}
|
|
69
|
-
* onPasswordChange={setPassword}
|
|
70
|
-
* onSubmit={handleSubmit}
|
|
71
|
-
* error={error}
|
|
72
|
-
* loading={loading}
|
|
73
|
-
* />
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, availableProviders, onOAuthClick, authConfig, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, showVerificationStep, onVerifyCode, verificationDescription, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Pre-built forgot password form component (UI only, no business logic).
|
|
80
|
-
*
|
|
81
|
-
* @component
|
|
82
|
-
* @example
|
|
83
|
-
* ```tsx
|
|
84
|
-
* const [email, setEmail] = useState('');
|
|
85
|
-
* const [error, setError] = useState('');
|
|
86
|
-
* const [loading, setLoading] = useState(false);
|
|
87
|
-
* const [success, setSuccess] = useState(false);
|
|
88
|
-
*
|
|
89
|
-
* const handleSubmit = async (e) => {
|
|
90
|
-
* e.preventDefault();
|
|
91
|
-
* setLoading(true);
|
|
92
|
-
* try {
|
|
93
|
-
* await authService.sendResetPasswordCode({ email });
|
|
94
|
-
* setSuccess(true);
|
|
95
|
-
* } catch (err) {
|
|
96
|
-
* setError(err.message);
|
|
97
|
-
* } finally {
|
|
98
|
-
* setLoading(false);
|
|
99
|
-
* }
|
|
100
|
-
* };
|
|
101
|
-
*
|
|
102
|
-
* <ForgotPasswordForm
|
|
103
|
-
* email={email}
|
|
104
|
-
* onEmailChange={setEmail}
|
|
105
|
-
* onSubmit={handleSubmit}
|
|
106
|
-
* error={error}
|
|
107
|
-
* loading={loading}
|
|
108
|
-
* success={success}
|
|
109
|
-
* />
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
declare function ForgotPasswordForm({ email, onEmailChange, onSubmit, error, loading, success, appearance, title, subtitle, emailLabel, emailPlaceholder, submitButtonText, loadingButtonText, backToSignInText, backToSignInUrl, successTitle, successMessage, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Pre-built reset password form component (UI only, no business logic).
|
|
116
|
-
*
|
|
117
|
-
* @component
|
|
118
|
-
* @example
|
|
119
|
-
* ```tsx
|
|
120
|
-
* const [newPassword, setNewPassword] = useState('');
|
|
121
|
-
* const [confirmPassword, setConfirmPassword] = useState('');
|
|
122
|
-
* const [error, setError] = useState('');
|
|
123
|
-
* const [loading, setLoading] = useState(false);
|
|
124
|
-
*
|
|
125
|
-
* const handleSubmit = async (e) => {
|
|
126
|
-
* e.preventDefault();
|
|
127
|
-
* if (newPassword !== confirmPassword) {
|
|
128
|
-
* setError('Passwords do not match');
|
|
129
|
-
* return;
|
|
130
|
-
* }
|
|
131
|
-
* setLoading(true);
|
|
132
|
-
* try {
|
|
133
|
-
* await authService.resetPassword({ newPassword, token });
|
|
134
|
-
* } catch (err) {
|
|
135
|
-
* setError(err.message);
|
|
136
|
-
* } finally {
|
|
137
|
-
* setLoading(false);
|
|
138
|
-
* }
|
|
139
|
-
* };
|
|
140
|
-
*
|
|
141
|
-
* <ResetPasswordForm
|
|
142
|
-
* newPassword={newPassword}
|
|
143
|
-
* confirmPassword={confirmPassword}
|
|
144
|
-
* onNewPasswordChange={setNewPassword}
|
|
145
|
-
* onConfirmPasswordChange={setConfirmPassword}
|
|
146
|
-
* onSubmit={handleSubmit}
|
|
147
|
-
* error={error}
|
|
148
|
-
* loading={loading}
|
|
149
|
-
* authConfig={config}
|
|
150
|
-
* />
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
declare function ResetPasswordForm({ newPassword, confirmPassword, onNewPasswordChange, onConfirmPasswordChange, onSubmit, error, loading, success, authConfig, appearance, title, subtitle, newPasswordLabel, newPasswordPlaceholder, confirmPasswordLabel, confirmPasswordPlaceholder, submitButtonText, loadingButtonText, backToSignInText, backToSignInUrl, successTitle, successMessage, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Email verification status display component (UI only, no business logic).
|
|
157
|
-
*
|
|
158
|
-
* @component
|
|
159
|
-
* @example
|
|
160
|
-
* ```tsx
|
|
161
|
-
* const [status, setStatus] = useState('verifying');
|
|
162
|
-
* const [error, setError] = useState('');
|
|
163
|
-
*
|
|
164
|
-
* useEffect(() => {
|
|
165
|
-
* const verify = async () => {
|
|
166
|
-
* try {
|
|
167
|
-
* await authService.verifyEmail({ token });
|
|
168
|
-
* setStatus('success');
|
|
169
|
-
* } catch (err) {
|
|
170
|
-
* setError(err.message);
|
|
171
|
-
* setStatus('error');
|
|
172
|
-
* }
|
|
173
|
-
* };
|
|
174
|
-
* verify();
|
|
175
|
-
* }, [token]);
|
|
176
|
-
*
|
|
177
|
-
* <VerifyEmailStatus
|
|
178
|
-
* status={status}
|
|
179
|
-
* error={error}
|
|
180
|
-
* />
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
declare function VerifyEmailStatus({ status, error, appearance, verifyingTitle, successTitle, successMessage, errorTitle, }: VerifyEmailStatusProps): react_jsx_runtime.JSX.Element;
|
|
184
|
-
|
|
185
|
-
export { ForgotPasswordForm, ResetPasswordForm, SignInForm, SignUpForm, VerifyEmailStatus };
|