@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.
- package/README.md +476 -604
- package/dist/atoms.cjs +837 -0
- package/dist/atoms.cjs.map +1 -0
- package/dist/atoms.d.cts +253 -0
- package/dist/atoms.d.ts +111 -245
- package/dist/atoms.js +412 -468
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +2000 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.d.cts +258 -0
- package/dist/components.d.ts +71 -123
- package/dist/components.js +1040 -1428
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +1194 -0
- package/dist/forms.cjs.map +1 -0
- package/dist/forms.d.cts +135 -0
- package/dist/forms.d.ts +113 -163
- package/dist/forms.js +657 -943
- 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 +2461 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +37 -22
- package/dist/index.d.ts +34 -19
- package/dist/index.js +1142 -1497
- 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.d.mts → router.d.cts} +0 -11
- package/dist/router.d.ts +0 -11
- package/dist/router.js +10 -16
- package/dist/router.js.map +1 -1
- package/dist/styles.css +864 -2
- package/dist/types.cjs +4 -0
- package/dist/{types.mjs.map → types.cjs.map} +1 -1
- package/dist/types.d.cts +32 -0
- package/dist/types.d.ts +11 -613
- package/dist/types.js +0 -1
- package/package.json +111 -98
- package/dist/atoms.d.mts +0 -387
- package/dist/atoms.mjs +0 -861
- package/dist/atoms.mjs.map +0 -1
- package/dist/components.d.mts +0 -310
- 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.d.mts +0 -634
- package/dist/types.mjs +0 -3
- package/src/styles.css +0 -15
package/dist/atoms.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import '@insforge/shared-schemas';
|
|
2
|
+
import { ReactNode, InputHTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
import { AuthConfig, EmailVerificationMethod } from './types.js';
|
|
4
|
+
import { OAuthProvidersSchema } from '@insforge/shared-schemas';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Insforge branding component for authentication pages.
|
|
@@ -14,6 +14,9 @@ import '@insforge/shared-schemas';
|
|
|
14
14
|
*/
|
|
15
15
|
declare function AuthBranding(): react_jsx_runtime.JSX.Element;
|
|
16
16
|
|
|
17
|
+
interface AuthContainerProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
17
20
|
/**
|
|
18
21
|
* Main container component for authentication forms.
|
|
19
22
|
*
|
|
@@ -24,203 +27,125 @@ declare function AuthBranding(): react_jsx_runtime.JSX.Element;
|
|
|
24
27
|
* <AuthHeader title="Sign In" />
|
|
25
28
|
* <form>...</form>
|
|
26
29
|
* </AuthContainer>
|
|
27
|
-
*
|
|
28
|
-
* // With custom styling
|
|
29
|
-
* <AuthContainer
|
|
30
|
-
* appearance={{
|
|
31
|
-
* cardClassName: "bg-gray-50"
|
|
32
|
-
* }}
|
|
33
|
-
* >
|
|
34
|
-
* <AuthHeader title="Sign In" />
|
|
35
|
-
* <form>...</form>
|
|
36
|
-
* </AuthContainer>
|
|
37
30
|
* ```
|
|
38
31
|
*
|
|
39
32
|
* @param {ReactNode} children - Form content
|
|
40
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
41
|
-
* - `appearance.containerClassName`: Outer container element
|
|
42
|
-
* - `appearance.cardClassName`: Inner card element (white background area)
|
|
43
33
|
*/
|
|
44
|
-
declare function AuthContainer({ children
|
|
34
|
+
declare function AuthContainer({ children }: AuthContainerProps): react_jsx_runtime.JSX.Element;
|
|
45
35
|
|
|
36
|
+
interface AuthHeaderProps {
|
|
37
|
+
title: string;
|
|
38
|
+
subtitle?: string;
|
|
39
|
+
}
|
|
46
40
|
/**
|
|
47
41
|
* Header component for authentication forms displaying title and optional subtitle.
|
|
48
42
|
*
|
|
49
43
|
* @component
|
|
50
44
|
* @example
|
|
51
45
|
* ```tsx
|
|
52
|
-
* // Basic usage
|
|
53
46
|
* <AuthHeader
|
|
54
47
|
* title="Welcome Back"
|
|
55
48
|
* subtitle="Sign in to continue"
|
|
56
49
|
* />
|
|
57
|
-
*
|
|
58
|
-
* // With custom styling
|
|
59
|
-
* <AuthHeader
|
|
60
|
-
* title="Welcome Back"
|
|
61
|
-
* appearance={{
|
|
62
|
-
* titleClassName: "text-purple-900 text-3xl",
|
|
63
|
-
* subtitleClassName: "text-purple-700"
|
|
64
|
-
* }}
|
|
65
|
-
* />
|
|
66
50
|
* ```
|
|
67
51
|
*
|
|
68
52
|
* @param {string} title - Main heading text
|
|
69
53
|
* @param {string} [subtitle] - Optional subheading text
|
|
70
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
71
|
-
* - `appearance.containerClassName`: Container element
|
|
72
|
-
* - `appearance.titleClassName`: Title element
|
|
73
|
-
* - `appearance.subtitleClassName`: Subtitle element
|
|
74
54
|
*/
|
|
75
|
-
declare function AuthHeader({ title, subtitle
|
|
55
|
+
declare function AuthHeader({ title, subtitle }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
|
|
76
56
|
|
|
57
|
+
interface AuthErrorBannerProps {
|
|
58
|
+
error: string;
|
|
59
|
+
}
|
|
77
60
|
/**
|
|
78
61
|
* Error message banner for authentication forms.
|
|
79
|
-
*
|
|
80
|
-
* @component
|
|
81
|
-
* @example
|
|
82
|
-
* ```tsx
|
|
83
|
-
* <AuthErrorBanner error={error} />
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* @param {string} error - Error message to display
|
|
87
|
-
* @param {string} [className] - Banner element classes
|
|
88
62
|
*/
|
|
89
|
-
declare function AuthErrorBanner({ error
|
|
63
|
+
declare function AuthErrorBanner({ error }: {
|
|
64
|
+
error?: string;
|
|
65
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
90
66
|
|
|
67
|
+
interface AuthFormFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
68
|
+
label: string;
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
91
71
|
/**
|
|
92
72
|
* Standard form input field with label for authentication forms.
|
|
93
73
|
*
|
|
94
74
|
* @component
|
|
95
75
|
* @example
|
|
96
76
|
* ```tsx
|
|
97
|
-
* // Basic usage
|
|
98
77
|
* <AuthFormField
|
|
99
78
|
* id="email"
|
|
100
79
|
* type="email"
|
|
101
80
|
* label="Email Address"
|
|
102
81
|
* />
|
|
103
|
-
*
|
|
104
|
-
* // With custom styling
|
|
105
|
-
* <AuthFormField
|
|
106
|
-
* id="email"
|
|
107
|
-
* label="Email"
|
|
108
|
-
* appearance={{
|
|
109
|
-
* containerClassName: "flex flex-col justify-center items-stretch gap-1",
|
|
110
|
-
* inputClassName: "border-blue-500 focus:ring-blue-500",
|
|
111
|
-
* labelClassName: "text-blue-900 font-semibold"
|
|
112
|
-
* }}
|
|
113
|
-
* />
|
|
114
82
|
* ```
|
|
115
83
|
*
|
|
116
84
|
* @param {string} label - Label text
|
|
117
85
|
* @param {string} id - Input element ID
|
|
118
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
119
|
-
* - `appearance.containerClassName`: Container element
|
|
120
|
-
* - `appearance.labelClassName`: Label element
|
|
121
|
-
* - `appearance.inputClassName`: Input element
|
|
122
86
|
*/
|
|
123
|
-
declare function AuthFormField({ label, id,
|
|
87
|
+
declare function AuthFormField({ label, id, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
|
|
124
88
|
|
|
89
|
+
interface AuthPasswordFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
90
|
+
label?: string;
|
|
91
|
+
id: string;
|
|
92
|
+
showStrengthIndicator?: boolean;
|
|
93
|
+
authConfig: AuthConfig;
|
|
94
|
+
forgotPasswordLink?: {
|
|
95
|
+
href: string;
|
|
96
|
+
text?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
125
99
|
/**
|
|
126
100
|
* Password input field with visibility toggle and optional strength indicator.
|
|
127
|
-
*
|
|
128
|
-
* @component
|
|
129
|
-
* @example
|
|
130
|
-
* ```tsx
|
|
131
|
-
* // With forgot password link
|
|
132
|
-
* <AuthPasswordField
|
|
133
|
-
* id="password"
|
|
134
|
-
* label="Password"
|
|
135
|
-
* forgotPasswordLink={{ href: '/forgot-password' }}
|
|
136
|
-
* authConfig={config}
|
|
137
|
-
* />
|
|
138
|
-
*
|
|
139
|
-
* // With custom styling
|
|
140
|
-
* <AuthPasswordField
|
|
141
|
-
* id="password"
|
|
142
|
-
* label="Password"
|
|
143
|
-
* authConfig={config}
|
|
144
|
-
* appearance={{
|
|
145
|
-
* inputClassName: "border-blue-500",
|
|
146
|
-
* labelClassName: "text-blue-900"
|
|
147
|
-
* }}
|
|
148
|
-
* />
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @param {string} label - Label text
|
|
152
|
-
* @param {string} id - Input element ID
|
|
153
|
-
* @param {boolean} [showStrengthIndicator] - Show password strength requirements
|
|
154
|
-
* @param {object} [forgotPasswordLink] - Forgot password link config
|
|
155
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
156
|
-
* - `appearance.containerClassName`: Container element
|
|
157
|
-
* - `appearance.labelClassName`: Label element
|
|
158
|
-
* - `appearance.inputClassName`: Input element
|
|
159
101
|
*/
|
|
160
|
-
declare function AuthPasswordField({ label, id, showStrengthIndicator, authConfig, forgotPasswordLink, value,
|
|
102
|
+
declare function AuthPasswordField({ label, id, showStrengthIndicator, authConfig, forgotPasswordLink, value, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
|
|
161
103
|
|
|
104
|
+
interface AuthPasswordStrengthIndicatorProps {
|
|
105
|
+
password: string;
|
|
106
|
+
config: AuthConfig;
|
|
107
|
+
}
|
|
162
108
|
/**
|
|
163
109
|
* Password strength indicator showing requirement checklist.
|
|
164
|
-
*
|
|
165
|
-
* @component
|
|
166
|
-
* @example
|
|
167
|
-
* ```tsx
|
|
168
|
-
* <AuthPasswordStrengthIndicator
|
|
169
|
-
* password={password}
|
|
170
|
-
* config={authConfig}
|
|
171
|
-
* />
|
|
172
|
-
*
|
|
173
|
-
* // With custom styling
|
|
174
|
-
* <AuthPasswordStrengthIndicator
|
|
175
|
-
* password={password}
|
|
176
|
-
* config={authConfig}
|
|
177
|
-
* appearance={{
|
|
178
|
-
* requirementClassName: "text-lg"
|
|
179
|
-
* }}
|
|
180
|
-
* />
|
|
181
|
-
* ```
|
|
182
|
-
*
|
|
183
|
-
* @param {string} password - Current password value
|
|
184
|
-
* @param {object} config - Email auth configuration
|
|
185
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
186
|
-
* - `appearance.containerClassName`: Container element
|
|
187
|
-
* - `appearance.requirementClassName`: Requirement text elements
|
|
188
|
-
*/
|
|
189
|
-
declare function AuthPasswordStrengthIndicator({ password, config, appearance, }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
190
|
-
/**
|
|
191
|
-
* Validates that a password meets all strength requirements based on email auth configuration.
|
|
192
|
-
*
|
|
193
|
-
* @param password - The password string to validate
|
|
194
|
-
* @param config - Email authentication configuration from backend
|
|
195
|
-
* @returns true if all requirements are met, false otherwise
|
|
196
110
|
*/
|
|
197
|
-
declare function
|
|
111
|
+
declare function AuthPasswordStrengthIndicator({ password, config, }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
198
112
|
|
|
113
|
+
interface AuthSubmitButtonProps {
|
|
114
|
+
children: ReactNode;
|
|
115
|
+
isLoading?: boolean;
|
|
116
|
+
confirmed?: boolean;
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
type?: 'button' | 'submit';
|
|
119
|
+
onClick?: () => void;
|
|
120
|
+
}
|
|
199
121
|
/**
|
|
200
|
-
* Primary
|
|
122
|
+
* Primary button for authentication forms with loading and confirmed states.
|
|
123
|
+
*
|
|
124
|
+
* Supports two modes:
|
|
125
|
+
* - **Form submit** (default): type="submit" - triggers form's onSubmit handler
|
|
126
|
+
* - **Action button**: type="button" + onClick - executes custom logic without form submission
|
|
201
127
|
*
|
|
202
128
|
* @component
|
|
203
129
|
* @example
|
|
204
130
|
* ```tsx
|
|
205
|
-
* //
|
|
131
|
+
* // Form submit button (default)
|
|
206
132
|
* <AuthSubmitButton isLoading={loading}>
|
|
207
133
|
* Sign In
|
|
208
134
|
* </AuthSubmitButton>
|
|
209
135
|
*
|
|
210
|
-
* //
|
|
211
|
-
* <AuthSubmitButton
|
|
212
|
-
*
|
|
136
|
+
* // Action button with click handler
|
|
137
|
+
* <AuthSubmitButton type="button" onClick={handleClick} isLoading={loading}>
|
|
138
|
+
* Verify Code
|
|
213
139
|
* </AuthSubmitButton>
|
|
214
140
|
* ```
|
|
215
|
-
*
|
|
216
|
-
* @param {ReactNode} children - Button text
|
|
217
|
-
* @param {boolean} [isLoading] - Loading state (shows spinner)
|
|
218
|
-
* @param {boolean} [confirmed] - Confirmed state (shows checkmark)
|
|
219
|
-
* @param {boolean} [disabled] - Disabled state
|
|
220
|
-
* @param {string} [className] - Button element classes
|
|
221
141
|
*/
|
|
222
|
-
declare function AuthSubmitButton({ children, isLoading, confirmed, disabled,
|
|
142
|
+
declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, type, onClick, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
223
143
|
|
|
144
|
+
interface AuthLinkProps {
|
|
145
|
+
text: string;
|
|
146
|
+
linkText: string;
|
|
147
|
+
href: string;
|
|
148
|
+
}
|
|
224
149
|
/**
|
|
225
150
|
* Call-to-action link component for navigation between auth pages.
|
|
226
151
|
*
|
|
@@ -232,63 +157,41 @@ declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, cl
|
|
|
232
157
|
* linkText="Sign up"
|
|
233
158
|
* href="/sign-up"
|
|
234
159
|
* />
|
|
235
|
-
*
|
|
236
|
-
* // With custom styling
|
|
237
|
-
* <AuthLink
|
|
238
|
-
* text="Don't have an account?"
|
|
239
|
-
* linkText="Sign up"
|
|
240
|
-
* href="/sign-up"
|
|
241
|
-
* appearance={{
|
|
242
|
-
* linkClassName: "text-blue-500"
|
|
243
|
-
* }}
|
|
244
|
-
* />
|
|
245
160
|
* ```
|
|
246
161
|
*
|
|
247
162
|
* @param {string} text - Regular text before the link
|
|
248
163
|
* @param {string} linkText - Clickable link text
|
|
249
164
|
* @param {string} href - Link URL
|
|
250
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
251
|
-
* - `appearance.containerClassName`: Container element
|
|
252
|
-
* - `appearance.linkClassName`: Link element
|
|
253
165
|
*/
|
|
254
|
-
declare function AuthLink({ text, linkText, href
|
|
166
|
+
declare function AuthLink({ text, linkText, href }: AuthLinkProps): react_jsx_runtime.JSX.Element;
|
|
255
167
|
|
|
168
|
+
interface AuthDividerProps {
|
|
169
|
+
text?: string;
|
|
170
|
+
}
|
|
256
171
|
/**
|
|
257
172
|
* Visual divider with optional centered text for auth forms.
|
|
258
|
-
*
|
|
259
|
-
* @component
|
|
260
|
-
* @example
|
|
261
|
-
* ```tsx
|
|
262
|
-
* <AuthDivider text="or" />
|
|
263
|
-
* ```
|
|
264
|
-
*
|
|
265
|
-
* @param {string} [text='or'] - Centered text
|
|
266
|
-
* @param {string} [className] - Divider element classes
|
|
267
173
|
*/
|
|
268
|
-
declare function AuthDivider({ text
|
|
174
|
+
declare function AuthDivider({ text }: AuthDividerProps): react_jsx_runtime.JSX.Element;
|
|
269
175
|
|
|
176
|
+
interface AuthOAuthButtonProps {
|
|
177
|
+
provider: OAuthProvidersSchema;
|
|
178
|
+
onClick: (provider: OAuthProvidersSchema) => void;
|
|
179
|
+
disabled?: boolean;
|
|
180
|
+
loading?: boolean;
|
|
181
|
+
displayMode?: 'full' | 'short' | 'icon';
|
|
182
|
+
style?: CSSProperties;
|
|
183
|
+
}
|
|
270
184
|
/**
|
|
271
185
|
* OAuth provider button with adaptive display modes.
|
|
272
|
-
*
|
|
273
|
-
* @component
|
|
274
|
-
* @example
|
|
275
|
-
* ```tsx
|
|
276
|
-
* <AuthOAuthButton
|
|
277
|
-
* provider="google"
|
|
278
|
-
* onClick={handleOAuth}
|
|
279
|
-
* displayMode="full"
|
|
280
|
-
* />
|
|
281
|
-
* ```
|
|
282
|
-
*
|
|
283
|
-
* @param {OAuthProvider} provider - Provider identifier (e.g., 'google', 'github')
|
|
284
|
-
* @param {function} onClick - Click handler
|
|
285
|
-
* @param {boolean} [disabled] - Disabled state
|
|
286
|
-
* @param {boolean} [loading] - Loading state (shows spinner)
|
|
287
|
-
* @param {string} [displayMode='full'] - Display mode ('full' | 'short' | 'icon')
|
|
288
|
-
* @param {string} [className] - Button element classes
|
|
289
186
|
*/
|
|
290
|
-
declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style,
|
|
187
|
+
declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style, }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
|
|
291
188
|
|
|
189
|
+
interface AuthOAuthProvidersProps {
|
|
190
|
+
providers: OAuthProvidersSchema[];
|
|
191
|
+
onClick: (provider: OAuthProvidersSchema) => void;
|
|
192
|
+
disabled?: boolean;
|
|
193
|
+
loading?: OAuthProvidersSchema | null;
|
|
194
|
+
}
|
|
292
195
|
/**
|
|
293
196
|
* Smart OAuth provider grid with adaptive layout.
|
|
294
197
|
*
|
|
@@ -296,78 +199,25 @@ declare function AuthOAuthButton({ provider, onClick, disabled, loading, display
|
|
|
296
199
|
* - 1 provider: Full-width
|
|
297
200
|
* - 2 or 4 providers: Two columns
|
|
298
201
|
* - 3+ providers: Three columns
|
|
299
|
-
*
|
|
300
|
-
* @component
|
|
301
|
-
* @example
|
|
302
|
-
* ```tsx
|
|
303
|
-
* <AuthOAuthProviders
|
|
304
|
-
* providers={['google', 'github', 'discord']}
|
|
305
|
-
* onClick={handleOAuth}
|
|
306
|
-
* loading={currentProvider}
|
|
307
|
-
* />
|
|
308
|
-
*
|
|
309
|
-
* // With custom styling
|
|
310
|
-
* <AuthOAuthProviders
|
|
311
|
-
* providers={['google', 'github']}
|
|
312
|
-
* onClick={handleOAuth}
|
|
313
|
-
* loading={currentProvider}
|
|
314
|
-
* appearance={{
|
|
315
|
-
* buttonClassName: "hover:bg-blue-50"
|
|
316
|
-
* }}
|
|
317
|
-
* />
|
|
318
|
-
* ```
|
|
319
|
-
*
|
|
320
|
-
* @param {OAuthProvider[]} providers - Provider identifiers array
|
|
321
|
-
* @param {function} onClick - Provider click handler
|
|
322
|
-
* @param {boolean} [disabled] - Disabled state for all buttons
|
|
323
|
-
* @param {OAuthProvider | null} loading - Currently loading provider
|
|
324
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
325
|
-
* - `appearance.containerClassName`: Grid container element
|
|
326
|
-
* - `appearance.buttonClassName`: OAuth button elements
|
|
327
202
|
*/
|
|
328
|
-
declare function AuthOAuthProviders({ providers, onClick, disabled, loading,
|
|
203
|
+
declare function AuthOAuthProviders({ providers, onClick, disabled, loading, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
|
|
329
204
|
|
|
205
|
+
interface AuthVerificationCodeInputProps {
|
|
206
|
+
length?: number;
|
|
207
|
+
value: string;
|
|
208
|
+
email: string;
|
|
209
|
+
onChange: (value: string) => void;
|
|
210
|
+
disabled?: boolean;
|
|
211
|
+
onComplete?: (code: string) => void;
|
|
212
|
+
}
|
|
330
213
|
/**
|
|
331
214
|
* 6-digit verification code input component with auto-focus and paste support.
|
|
332
|
-
*
|
|
333
|
-
* @component
|
|
334
|
-
* @example
|
|
335
|
-
* ```tsx
|
|
336
|
-
* const [code, setCode] = useState('');
|
|
337
|
-
*
|
|
338
|
-
* <AuthVerificationCodeInput
|
|
339
|
-
* email="user@example.com"
|
|
340
|
-
* value={code}
|
|
341
|
-
* onChange={setCode}
|
|
342
|
-
* />
|
|
343
|
-
*
|
|
344
|
-
* // With custom styling
|
|
345
|
-
* <AuthVerificationCodeInput
|
|
346
|
-
* email="user@example.com"
|
|
347
|
-
* value={code}
|
|
348
|
-
* onChange={setCode}
|
|
349
|
-
* appearance={{
|
|
350
|
-
* inputClassName: "border-blue-500"
|
|
351
|
-
* }}
|
|
352
|
-
* />
|
|
353
|
-
* ```
|
|
354
|
-
*
|
|
355
|
-
* @param {string} email - Email address to display in instructions
|
|
356
|
-
* @param {string} value - Current code value
|
|
357
|
-
* @param {function} onChange - Code change handler
|
|
358
|
-
* @param {number} [length=6] - Number of digits
|
|
359
|
-
* @param {boolean} [disabled] - Disabled state
|
|
360
|
-
* @param {object} [appearance] - Tailwind CSS classes for styling
|
|
361
|
-
* - `appearance.containerClassName`: Container element
|
|
362
|
-
* - `appearance.inputClassName`: Input elements
|
|
363
215
|
*/
|
|
364
|
-
declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, onComplete,
|
|
216
|
+
declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, onComplete, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
|
|
365
217
|
|
|
366
|
-
type VerificationMethod = 'code' | 'link';
|
|
367
218
|
interface AuthEmailVerificationStepProps {
|
|
368
219
|
email: string;
|
|
369
|
-
|
|
370
|
-
method?: VerificationMethod;
|
|
220
|
+
method?: EmailVerificationMethod;
|
|
371
221
|
onVerifyCode?: (code: string) => Promise<void>;
|
|
372
222
|
}
|
|
373
223
|
/**
|
|
@@ -382,6 +232,22 @@ interface AuthEmailVerificationStepProps {
|
|
|
382
232
|
*
|
|
383
233
|
* @param method - 'code' for OTP input, 'link' for magic link (default: 'code')
|
|
384
234
|
*/
|
|
385
|
-
declare function AuthEmailVerificationStep({ email,
|
|
235
|
+
declare function AuthEmailVerificationStep({ email, method, onVerifyCode, }: AuthEmailVerificationStepProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
|
|
237
|
+
interface AuthResetPasswordVerificationStepProps {
|
|
238
|
+
email: string;
|
|
239
|
+
method: EmailVerificationMethod;
|
|
240
|
+
onVerifyCode?: (code: string) => Promise<void>;
|
|
241
|
+
onResendEmail: () => Promise<void>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Reset password verification step component
|
|
245
|
+
*
|
|
246
|
+
* Handles the verification flow for password reset:
|
|
247
|
+
* - Shows appropriate UI based on method (code input or link message)
|
|
248
|
+
* - Manages countdown timer for resend functionality
|
|
249
|
+
* - Handles code verification for code method
|
|
250
|
+
*/
|
|
251
|
+
declare function AuthResetPasswordVerificationStep({ email, method, onVerifyCode, onResendEmail, }: AuthResetPasswordVerificationStepProps): react_jsx_runtime.JSX.Element;
|
|
386
252
|
|
|
387
|
-
export { AuthBranding, AuthContainer, AuthDivider, AuthEmailVerificationStep, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput,
|
|
253
|
+
export { AuthBranding, AuthContainer, type AuthContainerProps, AuthDivider, type AuthDividerProps, AuthEmailVerificationStep, AuthErrorBanner, type AuthErrorBannerProps, AuthFormField, type AuthFormFieldProps, AuthHeader, type AuthHeaderProps, AuthLink, type AuthLinkProps, AuthOAuthButton, type AuthOAuthButtonProps, AuthOAuthProviders, type AuthOAuthProvidersProps, AuthPasswordField, type AuthPasswordFieldProps, AuthPasswordStrengthIndicator, type AuthPasswordStrengthIndicatorProps, AuthResetPasswordVerificationStep, AuthSubmitButton, type AuthSubmitButtonProps, AuthVerificationCodeInput, type AuthVerificationCodeInputProps };
|