@insforge/react 0.3.5 → 0.4.5

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.
Files changed (66) hide show
  1. package/README.md +476 -604
  2. package/dist/atoms.cjs +837 -0
  3. package/dist/atoms.cjs.map +1 -0
  4. package/dist/atoms.d.cts +253 -0
  5. package/dist/atoms.d.ts +111 -245
  6. package/dist/atoms.js +412 -468
  7. package/dist/atoms.js.map +1 -1
  8. package/dist/components.cjs +2000 -0
  9. package/dist/components.cjs.map +1 -0
  10. package/dist/components.d.cts +258 -0
  11. package/dist/components.d.ts +71 -123
  12. package/dist/components.js +1040 -1428
  13. package/dist/components.js.map +1 -1
  14. package/dist/forms.cjs +1194 -0
  15. package/dist/forms.cjs.map +1 -0
  16. package/dist/forms.d.cts +135 -0
  17. package/dist/forms.d.ts +113 -163
  18. package/dist/forms.js +657 -943
  19. package/dist/forms.js.map +1 -1
  20. package/dist/{hooks.mjs → hooks.cjs} +15 -13
  21. package/dist/hooks.cjs.map +1 -0
  22. package/dist/{hooks.d.mts → hooks.d.cts} +1 -1
  23. package/dist/hooks.js +9 -15
  24. package/dist/hooks.js.map +1 -1
  25. package/dist/index.cjs +2461 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/{index.d.mts → index.d.cts} +37 -22
  28. package/dist/index.d.ts +34 -19
  29. package/dist/index.js +1142 -1497
  30. package/dist/index.js.map +1 -1
  31. package/dist/{lib.mjs → lib.cjs} +13 -11
  32. package/dist/lib.cjs.map +1 -0
  33. package/dist/{lib.d.mts → lib.d.cts} +1 -8
  34. package/dist/lib.d.ts +1 -8
  35. package/dist/lib.js +4 -17
  36. package/dist/lib.js.map +1 -1
  37. package/dist/{router.mjs → router.cjs} +14 -16
  38. package/dist/router.cjs.map +1 -0
  39. package/dist/{router.d.mts → router.d.cts} +0 -11
  40. package/dist/router.d.ts +0 -11
  41. package/dist/router.js +10 -16
  42. package/dist/router.js.map +1 -1
  43. package/dist/styles.css +864 -2
  44. package/dist/types.cjs +4 -0
  45. package/dist/{types.mjs.map → types.cjs.map} +1 -1
  46. package/dist/types.d.cts +32 -0
  47. package/dist/types.d.ts +11 -613
  48. package/dist/types.js +0 -1
  49. package/package.json +111 -98
  50. package/dist/atoms.d.mts +0 -387
  51. package/dist/atoms.mjs +0 -861
  52. package/dist/atoms.mjs.map +0 -1
  53. package/dist/components.d.mts +0 -310
  54. package/dist/components.mjs +0 -2327
  55. package/dist/components.mjs.map +0 -1
  56. package/dist/forms.d.mts +0 -185
  57. package/dist/forms.mjs +0 -1468
  58. package/dist/forms.mjs.map +0 -1
  59. package/dist/hooks.mjs.map +0 -1
  60. package/dist/index.mjs +0 -2724
  61. package/dist/index.mjs.map +0 -1
  62. package/dist/lib.mjs.map +0 -1
  63. package/dist/router.mjs.map +0 -1
  64. package/dist/types.d.mts +0 -634
  65. package/dist/types.mjs +0 -3
  66. package/src/styles.css +0 -15
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 };