@passflow/react 0.17.0 → 0.18.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.es.js +146 -133
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
  7. package/dist/src/components/form/reset-password/index.d.cts +2 -0
  8. package/dist/src/components/form/reset-password/index.d.ts +2 -0
  9. package/dist/src/components/form/reset-password/index.d.ts.map +1 -1
  10. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  11. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  12. package/dist/src/components/provider/passflow-provider.d.cts +1 -0
  13. package/dist/src/components/provider/passflow-provider.d.ts +1 -0
  14. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  15. package/dist/src/components/ui/button/index.d.ts.map +1 -1
  16. package/dist/src/components/ui/fields/field-otp.d.cts +3 -1
  17. package/dist/src/components/ui/fields/field-otp.d.ts +3 -1
  18. package/dist/src/components/ui/fields/field-otp.d.ts.map +1 -1
  19. package/dist/src/components/ui/login-screen/email-code.d.cts +10 -0
  20. package/dist/src/components/ui/login-screen/email-code.d.ts +10 -0
  21. package/dist/src/components/ui/login-screen/email-code.d.ts.map +1 -0
  22. package/dist/src/components/ui/login-screen/index.d.cts +1 -1
  23. package/dist/src/components/ui/login-screen/index.d.ts +1 -1
  24. package/dist/src/components/ui/login-screen/index.d.ts.map +1 -1
  25. package/dist/src/components/ui/login-screen/login-screen.d.ts.map +1 -1
  26. package/dist/src/components/ui/login-screen/new-password.d.cts +10 -0
  27. package/dist/src/components/ui/login-screen/new-password.d.ts +10 -0
  28. package/dist/src/components/ui/login-screen/new-password.d.ts.map +1 -0
  29. package/dist/src/components/ui/login-screen/status.d.ts.map +1 -1
  30. package/dist/src/components/ui/login-screen/types.d.cts +62 -3
  31. package/dist/src/components/ui/login-screen/types.d.ts +62 -3
  32. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
  33. package/dist/src/hooks/index.d.cts +1 -0
  34. package/dist/src/hooks/index.d.ts +1 -0
  35. package/dist/src/hooks/index.d.ts.map +1 -1
  36. package/dist/src/hooks/use-email-code-step.d.cts +39 -0
  37. package/dist/src/hooks/use-email-code-step.d.ts +39 -0
  38. package/dist/src/hooks/use-email-code-step.d.ts.map +1 -0
  39. package/dist/src/hooks/use-join-invite.d.ts.map +1 -1
  40. package/dist/src/hooks/use-reset-password.d.cts +14 -1
  41. package/dist/src/hooks/use-reset-password.d.ts +14 -1
  42. package/dist/src/hooks/use-reset-password.d.ts.map +1 -1
  43. package/dist/src/hooks/use-signin.d.cts +6 -0
  44. package/dist/src/hooks/use-signin.d.ts +6 -0
  45. package/dist/src/hooks/use-signin.d.ts.map +1 -1
  46. package/dist/src/hooks/use-signup.d.cts +6 -0
  47. package/dist/src/hooks/use-signup.d.ts +6 -0
  48. package/dist/src/hooks/use-signup.d.ts.map +1 -1
  49. package/dist/src/index.d.cts +1 -0
  50. package/dist/src/index.d.ts +1 -0
  51. package/dist/src/index.d.ts.map +1 -1
  52. package/dist/src/types/email-verification.d.cts +18 -0
  53. package/dist/src/types/email-verification.d.ts +18 -0
  54. package/dist/src/types/email-verification.d.ts.map +1 -0
  55. package/dist/src/types/index.d.cts +1 -0
  56. package/dist/src/types/index.d.ts +1 -0
  57. package/dist/src/types/index.d.ts.map +1 -1
  58. package/dist/src/utils/auth-error.d.cts +46 -0
  59. package/dist/src/utils/auth-error.d.ts +46 -0
  60. package/dist/src/utils/auth-error.d.ts.map +1 -1
  61. package/dist/src/utils/email-verification.d.cts +44 -0
  62. package/dist/src/utils/email-verification.d.ts +44 -0
  63. package/dist/src/utils/email-verification.d.ts.map +1 -0
  64. package/dist/src/utils/get-url-errors.d.ts.map +1 -1
  65. package/dist/src/utils/index.d.cts +2 -1
  66. package/dist/src/utils/index.d.ts +2 -1
  67. package/dist/src/utils/index.d.ts.map +1 -1
  68. package/dist/style.css +1 -1
  69. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/passflow/index.tsx"],"names":[],"mappings":"AAeA,OAAO,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAOL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAOlB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,YAAY,IAAI,oBAAoB,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhH,KAAK,iBAAiB,GAAG;IACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;CACxB,CACJ,CAAC;AAuOJ,eAAO,MAAM,YAAY,8DAA6C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/passflow/index.tsx"],"names":[],"mappings":"AAeA,OAAO,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAOL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAOlB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,YAAY,IAAI,oBAAoB,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhH,KAAK,iBAAiB,GAAG;IACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;CACxB,CACJ,CAAC;AA8OJ,eAAO,MAAM,YAAY,8DAA6C,CAAC"}
@@ -3,6 +3,8 @@ import type { SuccessAuthRedirect } from '../../../types/index.cjs';
3
3
  type TResetPassword = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  twoFactorVerifyPath?: string;
6
+ /** Where `Back to sign in` goes once the password is saved. */
7
+ signInPath?: string;
6
8
  };
7
9
  export declare const ResetPassword: FC<TResetPassword>;
8
10
  export {};
@@ -3,6 +3,8 @@ import type { SuccessAuthRedirect } from '../../../types/index.js';
3
3
  type TResetPassword = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  twoFactorVerifyPath?: string;
6
+ /** Where `Back to sign in` goes once the password is saved. */
7
+ signInPath?: string;
6
8
  };
7
9
  export declare const ResetPassword: FC<TResetPassword>;
8
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/reset-password/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,OAAO,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAUnD,KAAK,cAAc,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,cAAc,CAiJ5C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/reset-password/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAM5B,KAAK,cAAc,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAWF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,cAAc,CA8G5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signin/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkDnD,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CAyLlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signin/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAchC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkDnD,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CA0OlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signup/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAsDlE,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CAuKlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signup/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAchC,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAsDlE,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CAwNlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
@@ -57,6 +57,7 @@ type PassflowProviderProps = PassflowConfig & {
57
57
  * - /auth/passwordless/* — OTP / magic-link start+complete
58
58
  * - /auth/passkey/* — passkey registration/auth
59
59
  * - /auth/2fa/* — second-factor verify
60
+ * - /auth/validate — emailed sign-up / sign-in code
60
61
  * - /auth/federated/start — federated start (callback is server)
61
62
  * - /auth/session/exchange — RFC 8693-style session exchange
62
63
  * (ADR-2; activated on Leg 2 of
@@ -57,6 +57,7 @@ type PassflowProviderProps = PassflowConfig & {
57
57
  * - /auth/passwordless/* — OTP / magic-link start+complete
58
58
  * - /auth/passkey/* — passkey registration/auth
59
59
  * - /auth/2fa/* — second-factor verify
60
+ * - /auth/validate — emailed sign-up / sign-in code
60
61
  * - /auth/federated/start — federated start (callback is server)
61
62
  * - /auth/session/exchange — RFC 8693-style session exchange
62
63
  * (ADR-2; activated on Leg 2 of
@@ -1 +1 @@
1
- {"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,cAAc,EAA2B,MAAM,gBAAgB,CAAC;AAC7G,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAGpG,OAAO,EAIL,KAAK,gBAAgB,EAIrB,KAAK,UAAU,EAEhB,MAAM,WAAW,CAAC;AAEnB,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpG,KAAK,qBAAqB,GAAG,cAAc,GAAG;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAC3C;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,QACkE,CAAC;AAErG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,QAAO,MAAM,GAAG,SAQxD,CAAC;AAiCF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,QAAO,OAA+B,CAAC;AAqK3E;;;GAGG;AACH,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;;;;;;GAMG;AACH,KAAK,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAmLtF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAwCF,eAAO,MAAM,mBAAmB,yCAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0JtD,CAAC"}
1
+ {"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,cAAc,EAA2B,MAAM,gBAAgB,CAAC;AAC7G,OAAO,K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EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,OAAO,CA2F9B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react';
1
+ import type { FC, Ref } from 'react';
2
2
  export type FieldOtpCharset = 'numeric' | 'alphanumeric';
3
3
  export type FieldOtpState = 'default' | 'error' | 'disabled';
4
4
  type FieldOtpBaseProps = {
@@ -19,6 +19,8 @@ type FieldOtpBaseProps = {
19
19
  /** Id of the element that describes it, such as the error message. */
20
20
  describedBy?: string;
21
21
  autoFocus?: boolean;
22
+ /** The one real `<input>`, so a screen can return focus to it after the field was locked. */
23
+ ref?: Ref<HTMLInputElement>;
22
24
  };
23
25
  /**
24
26
  * The code field is named either by a visible label it draws itself (`label`),
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react';
1
+ import type { FC, Ref } from 'react';
2
2
  export type FieldOtpCharset = 'numeric' | 'alphanumeric';
3
3
  export type FieldOtpState = 'default' | 'error' | 'disabled';
4
4
  type FieldOtpBaseProps = {
@@ -19,6 +19,8 @@ type FieldOtpBaseProps = {
19
19
  /** Id of the element that describes it, such as the error message. */
20
20
  describedBy?: string;
21
21
  autoFocus?: boolean;
22
+ /** The one real `<input>`, so a screen can return focus to it after the field was locked. */
23
+ ref?: Ref<HTMLInputElement>;
22
24
  };
23
25
  /**
24
26
  * The code field is named either by a visible label it draws itself (`label`),
@@ -1 +1 @@
1
- {"version":3,"file":"field-otp.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-otp.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,cAAc,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,SAAS,GAA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;AAE7D,KAAK,iBAAiB,GAAG;IACvB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,+FAA+F;IAC/F,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6FAA6F;IAC7F,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,GACD;IACE,oGAAoG;IACpG,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CACJ,CAAC;AAsBJ;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA0DtC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { LoginEmailCodeState } from './types.cjs';
3
+ /**
4
+ * The emailed verification code step: the server's prompt names a row of code
5
+ * boxes; six digits submit by themselves. A failed verify or a resend clears the
6
+ * typed code. While a verify is in flight the code, Resend and the way back are
7
+ * locked, and focus returns to the code when it ends.
8
+ */
9
+ export declare const LoginEmailCode: FC<LoginEmailCodeState>;
10
+ //# sourceMappingURL=email-code.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { LoginEmailCodeState } from './types.js';
3
+ /**
4
+ * The emailed verification code step: the server's prompt names a row of code
5
+ * boxes; six digits submit by themselves. A failed verify or a resend clears the
6
+ * typed code. While a verify is in flight the code, Resend and the way back are
7
+ * locked, and focus returns to the code when it ends.
8
+ */
9
+ export declare const LoginEmailCode: FC<LoginEmailCodeState>;
10
+ //# sourceMappingURL=email-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-code.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/email-code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EAAwB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmEzE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAgGlD,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { LoginScreen } from './login-screen.cjs';
2
2
  export { LoginAlert } from './shared.cjs';
3
- export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginPasskeyProgressState, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.cjs';
3
+ export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginEmailCodeResend, LoginEmailCodeState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginNewPasswordState, LoginPasskeyProgressState, LoginScreenAction, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.cjs';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export { LoginScreen } from './login-screen.js';
2
2
  export { LoginAlert } from './shared.js';
3
- export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginPasskeyProgressState, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.js';
3
+ export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginEmailCodeResend, LoginEmailCodeState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginNewPasswordState, LoginPasskeyProgressState, LoginScreenAction, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,IAAI,sBAAsB,EAC3C,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,IAAI,sBAAsB,EAC3C,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/login-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAWhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6C5C,CAAC"}
1
+ {"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/login-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAahC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAmD5C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { LoginNewPasswordState } from './types.cjs';
3
+ /**
4
+ * Choosing a new password, checked against the app's password policy as it is
5
+ * typed: for a reset, or to finish an account started by email. The field keeps
6
+ * `id="password"`, and the button the `passflow-button-reset-password` class, so an
7
+ * app's custom CSS still finds them.
8
+ */
9
+ export declare const LoginNewPassword: FC<LoginNewPasswordState>;
10
+ //# sourceMappingURL=new-password.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { LoginNewPasswordState } from './types.js';
3
+ /**
4
+ * Choosing a new password, checked against the app's password policy as it is
5
+ * typed: for a reset, or to finish an account started by email. The field keeps
6
+ * `id="password"`, and the button the `passflow-button-reset-password` class, so an
7
+ * app's custom CSS still finds them.
8
+ */
9
+ export declare const LoginNewPassword: FC<LoginNewPasswordState>;
10
+ //# sourceMappingURL=new-password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/new-password.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoFtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAgC5C,CAAC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyC5C,CAAC"}
@@ -3,7 +3,11 @@ import type { AuthUiError, DefaultMethod } from '../../../types/index.cjs';
3
3
  export type LoginScreenChrome = {
4
4
  title: string;
5
5
  subtitle?: string;
6
- variant?: 'sign-in';
6
+ /**
7
+ * `sign-in` and `reset-password` keep the wrapper class (`passflow-signin-wrapper`,
8
+ * `passflow-reset-password-wrapper`) that an app's custom CSS may target.
9
+ */
10
+ variant?: 'sign-in' | 'reset-password';
7
11
  customCss?: string;
8
12
  customLogo?: string;
9
13
  customLogoAlt?: string;
@@ -80,6 +84,60 @@ export type LoginCodeEntryState = {
80
84
  testId?: string;
81
85
  onSubmit: (code: string) => void;
82
86
  };
87
+ /** The resend control of the emailed-code step. Omitted when the code cannot be sent again. */
88
+ export type LoginEmailCodeResend = {
89
+ /** Seconds the control waits before it can be pressed. Default 30; restarts on every press and on `restartKey` change. */
90
+ cooldownSeconds?: number;
91
+ /** Changes when a new code was sent (pass the challenge id): restarts the cooldown and clears the typed code. */
92
+ restartKey?: string;
93
+ /** A resend is in flight. */
94
+ busy?: boolean;
95
+ /** Default `Resend code`. */
96
+ label?: string;
97
+ onResend: () => void;
98
+ };
99
+ /** The way back out of the step, such as `Use a different email` or `Back to sign in`. */
100
+ export type LoginScreenAction = {
101
+ label: string;
102
+ onClick: () => void;
103
+ };
104
+ /**
105
+ * The emailed verification code step: the server's prompt, a row of code boxes,
106
+ * Verify, Resend and a way back.
107
+ */
108
+ export type LoginEmailCodeState = {
109
+ kind: 'email-code';
110
+ /** The server's prompt, such as "We sent a code to a***@example.com."; it also names the code field. */
111
+ message: string;
112
+ /** Digits in the code. Default 6. */
113
+ length?: number;
114
+ /** The server's answer to a failed verify or resend; clears the typed code. */
115
+ error?: string | null;
116
+ /** A verify is in flight: the code, Resend and the way back are locked. */
117
+ busy?: boolean;
118
+ /** Default `Verify`. */
119
+ submitLabel?: string;
120
+ resend?: LoginEmailCodeResend;
121
+ secondaryAction?: LoginScreenAction;
122
+ testId?: string;
123
+ onSubmit: (code: string) => void;
124
+ };
125
+ /** Choosing a new password: for a reset, or to finish an account started by email. */
126
+ export type LoginNewPasswordState = {
127
+ kind: 'new-password';
128
+ passwordPolicy: PassflowPasswordPolicySettings | null;
129
+ /** Default `New password`. */
130
+ label?: string;
131
+ /** Default `Enter your new password below.` */
132
+ hint?: string;
133
+ error?: string | null;
134
+ /** The password is being saved: the field and the button are locked. */
135
+ busy?: boolean;
136
+ /** Default `Save new password`. */
137
+ submitLabel?: string;
138
+ testId?: string;
139
+ onSubmit: (password: string) => void;
140
+ };
83
141
  export type LoginPasskeyProgressState = {
84
142
  kind: 'passkey-progress';
85
143
  working: boolean;
@@ -172,7 +230,8 @@ export type LoginConsentState = {
172
230
  };
173
231
  export type LoginStatusState = {
174
232
  kind: 'status';
175
- tone: 'success' | 'error' | 'disabled';
233
+ /** `info` is a neutral notice, such as "check your email"; it keeps the normal logo. */
234
+ tone: 'success' | 'error' | 'disabled' | 'info';
176
235
  message: string;
177
236
  detail?: string;
178
237
  recoverable?: boolean;
@@ -184,7 +243,7 @@ export type LoginStatusState = {
184
243
  onClick: () => void;
185
244
  };
186
245
  };
187
- export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
246
+ export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginEmailCodeState | LoginNewPasswordState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
188
247
  export type LoginScreenProps = {
189
248
  chrome: LoginScreenChrome;
190
249
  state: LoginScreenState;
@@ -3,7 +3,11 @@ import type { AuthUiError, DefaultMethod } from '../../../types/index.js';
3
3
  export type LoginScreenChrome = {
4
4
  title: string;
5
5
  subtitle?: string;
6
- variant?: 'sign-in';
6
+ /**
7
+ * `sign-in` and `reset-password` keep the wrapper class (`passflow-signin-wrapper`,
8
+ * `passflow-reset-password-wrapper`) that an app's custom CSS may target.
9
+ */
10
+ variant?: 'sign-in' | 'reset-password';
7
11
  customCss?: string;
8
12
  customLogo?: string;
9
13
  customLogoAlt?: string;
@@ -80,6 +84,60 @@ export type LoginCodeEntryState = {
80
84
  testId?: string;
81
85
  onSubmit: (code: string) => void;
82
86
  };
87
+ /** The resend control of the emailed-code step. Omitted when the code cannot be sent again. */
88
+ export type LoginEmailCodeResend = {
89
+ /** Seconds the control waits before it can be pressed. Default 30; restarts on every press and on `restartKey` change. */
90
+ cooldownSeconds?: number;
91
+ /** Changes when a new code was sent (pass the challenge id): restarts the cooldown and clears the typed code. */
92
+ restartKey?: string;
93
+ /** A resend is in flight. */
94
+ busy?: boolean;
95
+ /** Default `Resend code`. */
96
+ label?: string;
97
+ onResend: () => void;
98
+ };
99
+ /** The way back out of the step, such as `Use a different email` or `Back to sign in`. */
100
+ export type LoginScreenAction = {
101
+ label: string;
102
+ onClick: () => void;
103
+ };
104
+ /**
105
+ * The emailed verification code step: the server's prompt, a row of code boxes,
106
+ * Verify, Resend and a way back.
107
+ */
108
+ export type LoginEmailCodeState = {
109
+ kind: 'email-code';
110
+ /** The server's prompt, such as "We sent a code to a***@example.com."; it also names the code field. */
111
+ message: string;
112
+ /** Digits in the code. Default 6. */
113
+ length?: number;
114
+ /** The server's answer to a failed verify or resend; clears the typed code. */
115
+ error?: string | null;
116
+ /** A verify is in flight: the code, Resend and the way back are locked. */
117
+ busy?: boolean;
118
+ /** Default `Verify`. */
119
+ submitLabel?: string;
120
+ resend?: LoginEmailCodeResend;
121
+ secondaryAction?: LoginScreenAction;
122
+ testId?: string;
123
+ onSubmit: (code: string) => void;
124
+ };
125
+ /** Choosing a new password: for a reset, or to finish an account started by email. */
126
+ export type LoginNewPasswordState = {
127
+ kind: 'new-password';
128
+ passwordPolicy: PassflowPasswordPolicySettings | null;
129
+ /** Default `New password`. */
130
+ label?: string;
131
+ /** Default `Enter your new password below.` */
132
+ hint?: string;
133
+ error?: string | null;
134
+ /** The password is being saved: the field and the button are locked. */
135
+ busy?: boolean;
136
+ /** Default `Save new password`. */
137
+ submitLabel?: string;
138
+ testId?: string;
139
+ onSubmit: (password: string) => void;
140
+ };
83
141
  export type LoginPasskeyProgressState = {
84
142
  kind: 'passkey-progress';
85
143
  working: boolean;
@@ -172,7 +230,8 @@ export type LoginConsentState = {
172
230
  };
173
231
  export type LoginStatusState = {
174
232
  kind: 'status';
175
- tone: 'success' | 'error' | 'disabled';
233
+ /** `info` is a neutral notice, such as "check your email"; it keeps the normal logo. */
234
+ tone: 'success' | 'error' | 'disabled' | 'info';
176
235
  message: string;
177
236
  detail?: string;
178
237
  recoverable?: boolean;
@@ -184,7 +243,7 @@ export type LoginStatusState = {
184
243
  onClick: () => void;
185
244
  };
186
245
  };
187
- export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
246
+ export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginEmailCodeState | LoginNewPasswordState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
188
247
  export type LoginScreenProps = {
189
248
  chrome: LoginScreenChrome;
190
249
  state: LoginScreenState;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KA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AM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,mBAAmB,GACnB,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,GACtB,iBAAiB,GACjB,gBAAgB,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,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AAqB,GACrB,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,GACtB,iBAAiB,GACjB,gBAAgB,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC"}
@@ -3,6 +3,7 @@ export { useAuth } from './use-auth.cjs';
3
3
  export { useAuthCloudRedirect } from './use-auth-cloud-redirect.cjs';
4
4
  export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.cjs';
5
5
  export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.cjs';
6
+ export { type UseEmailCodeStep, type UseEmailCodeStepOptions, useEmailCodeStep, } from './use-email-code-step.cjs';
6
7
  export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.cjs';
7
8
  export { useJoinInvite } from './use-join-invite.cjs';
8
9
  export { type UseLogoutProps, useLogout } from './use-logout.cjs';
@@ -3,6 +3,7 @@ export { useAuth } from './use-auth.js';
3
3
  export { useAuthCloudRedirect } from './use-auth-cloud-redirect.js';
4
4
  export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.js';
5
5
  export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.js';
6
+ export { type UseEmailCodeStep, type UseEmailCodeStepOptions, useEmailCodeStep, } from './use-email-code-step.js';
6
7
  export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.js';
7
8
  export { useJoinInvite } from './use-join-invite.js';
8
9
  export { type UseLogoutProps, useLogout } from './use-logout.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"m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;AACrG,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,KAAK,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEtH,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,KAAK,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { PassflowAuthorizationResponse } from '@passflow/core';
2
+ import type { EmailCodeStep } from '../types/index.cjs';
3
+ export type UseEmailCodeStepOptions = {
4
+ /**
5
+ * Repeats the request that produced the step (the same sign-up or sign-in body). Absent when the code cannot be
6
+ * sent again, as after a password change: the reset link is spent.
7
+ */
8
+ resend?: () => Promise<unknown>;
9
+ /** The step ended (cancelled, verified, or turned into a link): anything held only for resend can be dropped. */
10
+ onRelease?: () => void;
11
+ };
12
+ export type UseEmailCodeStep = {
13
+ step: EmailCodeStep;
14
+ /** Enters the step when `answer` is an email verification step; `false` (nothing changes) for any other answer. */
15
+ enter: (answer: unknown) => boolean;
16
+ /**
17
+ * Posts the code. Resolves the session answer on success (the caller runs its post-auth path), `null` on a failure
18
+ * (shown in `error`), when a verify is already in flight, or when the step was left meanwhile.
19
+ */
20
+ verify: (otp: string) => Promise<PassflowAuthorizationResponse | null>;
21
+ /**
22
+ * Sends a new code by repeating the original request. Resolves `null` normally (the step moves to the new code or
23
+ * to the link); resolves the session answer in the rare case the repeated request signed the user in directly.
24
+ */
25
+ resend: () => Promise<PassflowAuthorizationResponse | null>;
26
+ canResend: boolean;
27
+ /** Leaves the step for the screen's own form. Ignored while a verify is in flight. */
28
+ cancel: () => void;
29
+ isVerifying: boolean;
30
+ isResending: boolean;
31
+ error: string | null;
32
+ };
33
+ /**
34
+ * The emailed-code step of a sign-up, sign-in or password change: holds the step, posts the code with
35
+ * `passflow.verifyEmailCode`, and resends by repeating the original request. An answer that arrives after the user
36
+ * left the step (or after a newer step replaced it) is dropped.
37
+ */
38
+ export declare const useEmailCodeStep: (options?: UseEmailCodeStepOptions) => UseEmailCodeStep;
39
+ //# sourceMappingURL=use-email-code-step.d.ts.map
@@ -0,0 +1,39 @@
1
+ import type { PassflowAuthorizationResponse } from '@passflow/core';
2
+ import type { EmailCodeStep } from '../types/index.js';
3
+ export type UseEmailCodeStepOptions = {
4
+ /**
5
+ * Repeats the request that produced the step (the same sign-up or sign-in body). Absent when the code cannot be
6
+ * sent again, as after a password change: the reset link is spent.
7
+ */
8
+ resend?: () => Promise<unknown>;
9
+ /** The step ended (cancelled, verified, or turned into a link): anything held only for resend can be dropped. */
10
+ onRelease?: () => void;
11
+ };
12
+ export type UseEmailCodeStep = {
13
+ step: EmailCodeStep;
14
+ /** Enters the step when `answer` is an email verification step; `false` (nothing changes) for any other answer. */
15
+ enter: (answer: unknown) => boolean;
16
+ /**
17
+ * Posts the code. Resolves the session answer on success (the caller runs its post-auth path), `null` on a failure
18
+ * (shown in `error`), when a verify is already in flight, or when the step was left meanwhile.
19
+ */
20
+ verify: (otp: string) => Promise<PassflowAuthorizationResponse | null>;
21
+ /**
22
+ * Sends a new code by repeating the original request. Resolves `null` normally (the step moves to the new code or
23
+ * to the link); resolves the session answer in the rare case the repeated request signed the user in directly.
24
+ */
25
+ resend: () => Promise<PassflowAuthorizationResponse | null>;
26
+ canResend: boolean;
27
+ /** Leaves the step for the screen's own form. Ignored while a verify is in flight. */
28
+ cancel: () => void;
29
+ isVerifying: boolean;
30
+ isResending: boolean;
31
+ error: string | null;
32
+ };
33
+ /**
34
+ * The emailed-code step of a sign-up, sign-in or password change: holds the step, posts the code with
35
+ * `passflow.verifyEmailCode`, and resends by repeating the original request. An answer that arrives after the user
36
+ * left the step (or after a newer step replaced it) is dropped.
37
+ */
38
+ export declare const useEmailCodeStep: (options?: UseEmailCodeStepOptions) => UseEmailCodeStep;
39
+ //# sourceMappingURL=use-email-code-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-email-code-step.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-email-code-step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,iHAAiH;IACjH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,mHAAmH;IACnH,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACpC;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC,CAAC;IACvE;;;OAGG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC,CAAC;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,aAAa,uBAAuB,KAAQ,gBAiIxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-join-invite.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-join-invite.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,kBA4B3B,CAAC"}
1
+ {"version":3,"file":"use-join-invite.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-join-invite.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAAG,MAAM;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,kBA4B3B,CAAC"}
@@ -1,9 +1,22 @@
1
+ import { type UseEmailCodeStep } from './use-email-code-step.cjs';
1
2
  export type UseResetPasswordProps = () => {
2
- fetch: (newPassword: string) => Promise<boolean>;
3
+ /**
4
+ * Saves the new password. Pass the reset link's `token` when you have it: without it core looks for `?token=` in
5
+ * the address bar, which a hash or memory router does not keep. Resolves `true` for a session, `false` on an error
6
+ * or when the server asks for an emailed code first (`emailCode` then holds the step).
7
+ */
8
+ fetch: (newPassword: string, resetToken?: string) => Promise<boolean>;
3
9
  isLoading: boolean;
4
10
  isError: boolean;
5
11
  error: string;
12
+ /**
13
+ * The password was changed, but the emailed code that should follow was refused for now (429). Asking for the
14
+ * password again would be wrong: the user should sign in with it later.
15
+ */
16
+ isPasswordSaved: boolean;
6
17
  reset: () => void;
18
+ /** The emailed-code step a password change may answer with. No resend: the reset link is spent. */
19
+ emailCode: UseEmailCodeStep;
7
20
  };
8
21
  export declare const useResetPassword: UseResetPasswordProps;
9
22
  //# sourceMappingURL=use-reset-password.d.ts.map
@@ -1,9 +1,22 @@
1
+ import { type UseEmailCodeStep } from './use-email-code-step.js';
1
2
  export type UseResetPasswordProps = () => {
2
- fetch: (newPassword: string) => Promise<boolean>;
3
+ /**
4
+ * Saves the new password. Pass the reset link's `token` when you have it: without it core looks for `?token=` in
5
+ * the address bar, which a hash or memory router does not keep. Resolves `true` for a session, `false` on an error
6
+ * or when the server asks for an emailed code first (`emailCode` then holds the step).
7
+ */
8
+ fetch: (newPassword: string, resetToken?: string) => Promise<boolean>;
3
9
  isLoading: boolean;
4
10
  isError: boolean;
5
11
  error: string;
12
+ /**
13
+ * The password was changed, but the emailed code that should follow was refused for now (429). Asking for the
14
+ * password again would be wrong: the user should sign in with it later.
15
+ */
16
+ isPasswordSaved: boolean;
6
17
  reset: () => void;
18
+ /** The emailed-code step a password change may answer with. No resend: the reset link is spent. */
19
+ emailCode: UseEmailCodeStep;
7
20
  };
8
21
  export declare const useResetPassword: UseResetPasswordProps;
9
22
  //# sourceMappingURL=use-reset-password.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-reset-password.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-reset-password.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,qBAAqB,GAAG,MAAM;IACxC,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,qBA8B9B,CAAC"}
1
+ {"version":3,"file":"use-reset-password.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-reset-password.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAGhF,MAAM,MAAM,qBAAqB,GAAG,MAAM;IACxC;;;;OAIG;IACH,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mGAAmG;IACnG,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,qBAuC9B,CAAC"}