@aaspai/react 0.0.0 → 0.0.2

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 (55) hide show
  1. package/README.md +720 -8
  2. package/dist/atoms.cjs +3565 -0
  3. package/dist/atoms.cjs.map +1 -0
  4. package/dist/atoms.d.cts +255 -0
  5. package/dist/atoms.d.ts +255 -0
  6. package/dist/atoms.js +3530 -0
  7. package/dist/atoms.js.map +1 -0
  8. package/dist/components.cjs +5397 -0
  9. package/dist/components.cjs.map +1 -0
  10. package/dist/components.d.cts +362 -0
  11. package/dist/components.d.ts +362 -0
  12. package/dist/components.js +5344 -0
  13. package/dist/components.js.map +1 -0
  14. package/dist/forms.cjs +3928 -0
  15. package/dist/forms.cjs.map +1 -0
  16. package/dist/forms.d.cts +135 -0
  17. package/dist/forms.d.ts +135 -0
  18. package/dist/forms.js +3903 -0
  19. package/dist/forms.js.map +1 -0
  20. package/dist/hooks.cjs +74 -0
  21. package/dist/hooks.cjs.map +1 -0
  22. package/dist/hooks.d.cts +138 -0
  23. package/dist/hooks.d.ts +138 -0
  24. package/dist/hooks.js +70 -0
  25. package/dist/hooks.js.map +1 -0
  26. package/dist/index.cjs +6030 -0
  27. package/dist/index.cjs.map +1 -0
  28. package/dist/index.d.cts +248 -0
  29. package/dist/index.d.ts +248 -0
  30. package/dist/index.js +5952 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/lib.cjs +139 -0
  33. package/dist/lib.cjs.map +1 -0
  34. package/dist/lib.d.cts +111 -0
  35. package/dist/lib.d.ts +111 -0
  36. package/dist/lib.js +128 -0
  37. package/dist/lib.js.map +1 -0
  38. package/dist/navigation.cjs +56 -0
  39. package/dist/navigation.cjs.map +1 -0
  40. package/dist/navigation.d.cts +65 -0
  41. package/dist/navigation.d.ts +65 -0
  42. package/dist/navigation.js +51 -0
  43. package/dist/navigation.js.map +1 -0
  44. package/dist/styles.css +839 -0
  45. package/dist/types.cjs +4 -0
  46. package/dist/types.cjs.map +1 -0
  47. package/dist/types.d.cts +17 -0
  48. package/dist/types.d.ts +17 -0
  49. package/dist/types.js +3 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +67 -28
  52. package/index.cjs +0 -10
  53. package/index.d.ts +0 -6
  54. package/index.js +0 -5
  55. package/styles.css +0 -1
@@ -0,0 +1,135 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { OAuthProvidersSchema } from '@aaspai/shared-schemas';
3
+ import { FormEvent } from 'react';
4
+ import { AuthConfig } from './types.cjs';
5
+ import '@aaspai/shared';
6
+
7
+ interface SignInFormProps {
8
+ email: string;
9
+ password: string;
10
+ onEmailChange: (email: string) => void;
11
+ onPasswordChange: (password: string) => void;
12
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
13
+ error?: string;
14
+ loading?: boolean;
15
+ oauthLoading?: OAuthProvidersSchema | null;
16
+ onOAuthClick?: (provider: OAuthProvidersSchema) => void;
17
+ authConfig: AuthConfig;
18
+ title?: string;
19
+ subtitle?: string;
20
+ emailLabel?: string;
21
+ emailPlaceholder?: string;
22
+ passwordLabel?: string;
23
+ passwordPlaceholder?: string;
24
+ forgotPasswordText?: string;
25
+ forgotPasswordUrl?: string;
26
+ submitButtonText?: string;
27
+ loadingButtonText?: string;
28
+ signUpText?: string;
29
+ signUpLinkText?: string;
30
+ signUpUrl?: string;
31
+ dividerText?: string;
32
+ showVerificationStep?: boolean;
33
+ onVerifyCode?: (code: string) => Promise<void>;
34
+ }
35
+ /**
36
+ * Pre-built sign-in form component (UI only, no business logic).
37
+ */
38
+ declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, onOAuthClick, authConfig, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, showVerificationStep, onVerifyCode, }: SignInFormProps): react_jsx_runtime.JSX.Element;
39
+
40
+ interface SignUpFormProps {
41
+ email: string;
42
+ password: string;
43
+ onEmailChange: (email: string) => void;
44
+ onPasswordChange: (password: string) => void;
45
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
46
+ error?: string;
47
+ loading?: boolean;
48
+ oauthLoading?: OAuthProvidersSchema | null;
49
+ onOAuthClick?: (provider: OAuthProvidersSchema) => void;
50
+ authConfig: AuthConfig;
51
+ title?: string;
52
+ subtitle?: string;
53
+ emailLabel?: string;
54
+ emailPlaceholder?: string;
55
+ passwordLabel?: string;
56
+ passwordPlaceholder?: string;
57
+ submitButtonText?: string;
58
+ loadingButtonText?: string;
59
+ signInText?: string;
60
+ signInLinkText?: string;
61
+ signInUrl?: string;
62
+ dividerText?: string;
63
+ showVerificationStep?: boolean;
64
+ onVerifyCode?: (code: string) => Promise<void>;
65
+ }
66
+ /**
67
+ * Pre-built sign-up form component (UI only, no business logic).
68
+ */
69
+ declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, onOAuthClick, authConfig, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, showVerificationStep, onVerifyCode, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
70
+
71
+ type ResetPasswordMethod = 'code' | 'link';
72
+ interface ForgotPasswordFormProps {
73
+ email: string;
74
+ onEmailChange: (email: string) => void;
75
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
76
+ error?: string;
77
+ loading?: boolean;
78
+ title?: string;
79
+ subtitle?: string;
80
+ emailLabel?: string;
81
+ emailPlaceholder?: string;
82
+ submitButtonText?: string;
83
+ loadingButtonText?: string;
84
+ backToSignInText?: string;
85
+ backToSignInUrl?: string;
86
+ showVerificationStep?: boolean;
87
+ resetPasswordMethod?: ResetPasswordMethod;
88
+ onVerifyCode?: (code: string) => Promise<void>;
89
+ onResendEmail?: () => Promise<void>;
90
+ }
91
+ /**
92
+ * Pre-built forgot password form component (UI only, no business logic).
93
+ */
94
+ declare function ForgotPasswordForm({ email, onEmailChange, onSubmit, error, loading, title, subtitle, emailLabel, emailPlaceholder, submitButtonText, loadingButtonText, backToSignInText, backToSignInUrl, showVerificationStep, resetPasswordMethod, onVerifyCode, onResendEmail, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
95
+
96
+ interface ResetPasswordFormProps {
97
+ newPassword: string;
98
+ confirmPassword: string;
99
+ onNewPasswordChange: (password: string) => void;
100
+ onConfirmPasswordChange: (password: string) => void;
101
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
102
+ error?: string;
103
+ loading?: boolean;
104
+ success?: boolean;
105
+ authConfig: AuthConfig;
106
+ title?: string;
107
+ subtitle?: string;
108
+ newPasswordLabel?: string;
109
+ newPasswordPlaceholder?: string;
110
+ confirmPasswordLabel?: string;
111
+ confirmPasswordPlaceholder?: string;
112
+ submitButtonText?: string;
113
+ loadingButtonText?: string;
114
+ successTitle?: string;
115
+ }
116
+ /**
117
+ * Pre-built reset password form component (UI only, no business logic).
118
+ */
119
+ declare function ResetPasswordForm({ newPassword, confirmPassword, onNewPasswordChange, onConfirmPasswordChange, onSubmit, error, loading, success, authConfig, title, subtitle, newPasswordLabel, newPasswordPlaceholder, confirmPasswordLabel, confirmPasswordPlaceholder, submitButtonText, loadingButtonText, successTitle, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
120
+
121
+ interface VerifyEmailStatusProps {
122
+ status: 'verifying' | 'success' | 'error';
123
+ error?: string;
124
+ verifyingTitle?: string;
125
+ successTitle?: string;
126
+ successMessage?: string;
127
+ errorTitle?: string;
128
+ }
129
+ /**
130
+ * Email verification status display component (UI only, no business logic).
131
+ */
132
+ declare function VerifyEmailStatus({ status, error, verifyingTitle, successTitle, successMessage, errorTitle, }: VerifyEmailStatusProps): react_jsx_runtime.JSX.Element;
133
+
134
+ export { ForgotPasswordForm, type ForgotPasswordFormProps, ResetPasswordForm, type ResetPasswordFormProps, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, VerifyEmailStatus, type VerifyEmailStatusProps };
135
+
@@ -0,0 +1,135 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { OAuthProvidersSchema } from '@aaspai/shared-schemas';
3
+ import { FormEvent } from 'react';
4
+ import { AuthConfig } from './types.js';
5
+ import '@aaspai/shared';
6
+
7
+ interface SignInFormProps {
8
+ email: string;
9
+ password: string;
10
+ onEmailChange: (email: string) => void;
11
+ onPasswordChange: (password: string) => void;
12
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
13
+ error?: string;
14
+ loading?: boolean;
15
+ oauthLoading?: OAuthProvidersSchema | null;
16
+ onOAuthClick?: (provider: OAuthProvidersSchema) => void;
17
+ authConfig: AuthConfig;
18
+ title?: string;
19
+ subtitle?: string;
20
+ emailLabel?: string;
21
+ emailPlaceholder?: string;
22
+ passwordLabel?: string;
23
+ passwordPlaceholder?: string;
24
+ forgotPasswordText?: string;
25
+ forgotPasswordUrl?: string;
26
+ submitButtonText?: string;
27
+ loadingButtonText?: string;
28
+ signUpText?: string;
29
+ signUpLinkText?: string;
30
+ signUpUrl?: string;
31
+ dividerText?: string;
32
+ showVerificationStep?: boolean;
33
+ onVerifyCode?: (code: string) => Promise<void>;
34
+ }
35
+ /**
36
+ * Pre-built sign-in form component (UI only, no business logic).
37
+ */
38
+ declare function SignInForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, onOAuthClick, authConfig, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, forgotPasswordText, forgotPasswordUrl, submitButtonText, loadingButtonText, signUpText, signUpLinkText, signUpUrl, dividerText, showVerificationStep, onVerifyCode, }: SignInFormProps): react_jsx_runtime.JSX.Element;
39
+
40
+ interface SignUpFormProps {
41
+ email: string;
42
+ password: string;
43
+ onEmailChange: (email: string) => void;
44
+ onPasswordChange: (password: string) => void;
45
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
46
+ error?: string;
47
+ loading?: boolean;
48
+ oauthLoading?: OAuthProvidersSchema | null;
49
+ onOAuthClick?: (provider: OAuthProvidersSchema) => void;
50
+ authConfig: AuthConfig;
51
+ title?: string;
52
+ subtitle?: string;
53
+ emailLabel?: string;
54
+ emailPlaceholder?: string;
55
+ passwordLabel?: string;
56
+ passwordPlaceholder?: string;
57
+ submitButtonText?: string;
58
+ loadingButtonText?: string;
59
+ signInText?: string;
60
+ signInLinkText?: string;
61
+ signInUrl?: string;
62
+ dividerText?: string;
63
+ showVerificationStep?: boolean;
64
+ onVerifyCode?: (code: string) => Promise<void>;
65
+ }
66
+ /**
67
+ * Pre-built sign-up form component (UI only, no business logic).
68
+ */
69
+ declare function SignUpForm({ email, password, onEmailChange, onPasswordChange, onSubmit, error, loading, oauthLoading, onOAuthClick, authConfig, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, showVerificationStep, onVerifyCode, }: SignUpFormProps): react_jsx_runtime.JSX.Element;
70
+
71
+ type ResetPasswordMethod = 'code' | 'link';
72
+ interface ForgotPasswordFormProps {
73
+ email: string;
74
+ onEmailChange: (email: string) => void;
75
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
76
+ error?: string;
77
+ loading?: boolean;
78
+ title?: string;
79
+ subtitle?: string;
80
+ emailLabel?: string;
81
+ emailPlaceholder?: string;
82
+ submitButtonText?: string;
83
+ loadingButtonText?: string;
84
+ backToSignInText?: string;
85
+ backToSignInUrl?: string;
86
+ showVerificationStep?: boolean;
87
+ resetPasswordMethod?: ResetPasswordMethod;
88
+ onVerifyCode?: (code: string) => Promise<void>;
89
+ onResendEmail?: () => Promise<void>;
90
+ }
91
+ /**
92
+ * Pre-built forgot password form component (UI only, no business logic).
93
+ */
94
+ declare function ForgotPasswordForm({ email, onEmailChange, onSubmit, error, loading, title, subtitle, emailLabel, emailPlaceholder, submitButtonText, loadingButtonText, backToSignInText, backToSignInUrl, showVerificationStep, resetPasswordMethod, onVerifyCode, onResendEmail, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
95
+
96
+ interface ResetPasswordFormProps {
97
+ newPassword: string;
98
+ confirmPassword: string;
99
+ onNewPasswordChange: (password: string) => void;
100
+ onConfirmPasswordChange: (password: string) => void;
101
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
102
+ error?: string;
103
+ loading?: boolean;
104
+ success?: boolean;
105
+ authConfig: AuthConfig;
106
+ title?: string;
107
+ subtitle?: string;
108
+ newPasswordLabel?: string;
109
+ newPasswordPlaceholder?: string;
110
+ confirmPasswordLabel?: string;
111
+ confirmPasswordPlaceholder?: string;
112
+ submitButtonText?: string;
113
+ loadingButtonText?: string;
114
+ successTitle?: string;
115
+ }
116
+ /**
117
+ * Pre-built reset password form component (UI only, no business logic).
118
+ */
119
+ declare function ResetPasswordForm({ newPassword, confirmPassword, onNewPasswordChange, onConfirmPasswordChange, onSubmit, error, loading, success, authConfig, title, subtitle, newPasswordLabel, newPasswordPlaceholder, confirmPasswordLabel, confirmPasswordPlaceholder, submitButtonText, loadingButtonText, successTitle, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
120
+
121
+ interface VerifyEmailStatusProps {
122
+ status: 'verifying' | 'success' | 'error';
123
+ error?: string;
124
+ verifyingTitle?: string;
125
+ successTitle?: string;
126
+ successMessage?: string;
127
+ errorTitle?: string;
128
+ }
129
+ /**
130
+ * Email verification status display component (UI only, no business logic).
131
+ */
132
+ declare function VerifyEmailStatus({ status, error, verifyingTitle, successTitle, successMessage, errorTitle, }: VerifyEmailStatusProps): react_jsx_runtime.JSX.Element;
133
+
134
+ export { ForgotPasswordForm, type ForgotPasswordFormProps, ResetPasswordForm, type ResetPasswordFormProps, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, VerifyEmailStatus, type VerifyEmailStatusProps };
135
+