doct-ui-auth-kit 1.0.16 → 1.0.18
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/hooks/index.d.ts +1 -0
- package/dist/hooks/use-form-state-persistence.d.ts +20 -0
- package/dist/index.js +675 -672
- package/dist/pages.js +1 -1
- package/dist/{signup-page-DlKFcIGU.js → signup-page-C4ccMx69.js} +528 -470
- package/dist/utils/form-state-storage.d.ts +27 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { useFormStatePersistence } from './use-form-state-persistence';
|
|
1
2
|
export { type EmailFormValues, type LoginEntryFormValues, type LoginEntryMode, type PhoneFormValues, type UseLoginEntryFormOptions, type UseLoginEntryFormReturn, useLoginEntryForm, } from './use-login-entry-form';
|
|
2
3
|
export { type MainAuthPageHandlers, type MainLoginAppleProviderConfig, type MainLoginGoogleProviderConfig, type MainLoginPageProvidersConfig, type UseMainAuthPageHandlersOptions, useMainAuthPageHandlers, } from './use-main-auth-page-handlers';
|
|
3
4
|
export { DEFAULT_OTP_TITLES, OTP_LENGTH, type OtpFormValues, type OtpVerificationMode, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, type UseOtpVerificationOptions, type UseOtpVerificationReturn, useOtpVerification, } from './use-otp-verification';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
/**
|
|
3
|
+
* Binds a react-hook-form to `sessionStorage` so the user's typed values
|
|
4
|
+
* survive back-button navigation between auth steps.
|
|
5
|
+
*
|
|
6
|
+
* Behaviour:
|
|
7
|
+
* - On first mount, hydrates the form from storage (overrides
|
|
8
|
+
* `useForm({ defaultValues })`).
|
|
9
|
+
* - On every field change, mirrors the current values to storage via
|
|
10
|
+
* `methods.watch`.
|
|
11
|
+
*
|
|
12
|
+
* Cleared globally on successful auth — see `clearAllFormState()` in
|
|
13
|
+
* `auth-provider.tsx`.
|
|
14
|
+
*
|
|
15
|
+
* @param key Stable identifier for this logical form. Different form
|
|
16
|
+
* modes (phone vs email, signup vs foreign signup) MUST use distinct
|
|
17
|
+
* keys so they don't clobber each other.
|
|
18
|
+
* @param methods The `useForm()` return value to bind.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useFormStatePersistence<T extends FieldValues>(key: string, methods: UseFormReturn<T>): void;
|