@passflow/react 0.25.3 → 0.26.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 (124) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +175 -18
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.es.js +146 -143
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/app.d.cts +5 -0
  8. package/dist/src/app.d.ts +5 -0
  9. package/dist/src/app.d.ts.map +1 -0
  10. package/dist/src/components/flow/index.d.cts +2 -0
  11. package/dist/src/components/flow/index.d.ts +2 -0
  12. package/dist/src/components/flow/index.d.ts.map +1 -1
  13. package/dist/src/components/flow/two-factor-setup/index.d.cts +1 -2
  14. package/dist/src/components/flow/two-factor-setup/index.d.ts +1 -2
  15. package/dist/src/components/flow/two-factor-setup/index.d.ts.map +1 -1
  16. package/dist/src/components/flow/two-factor-verify/index.d.cts +1 -2
  17. package/dist/src/components/flow/two-factor-verify/index.d.ts +1 -2
  18. package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
  19. package/dist/src/components/form/forgot-password/forgot-password.d.ts.map +1 -1
  20. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  21. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  22. package/dist/src/components/form/two-factor-challenge/index.d.ts.map +1 -1
  23. package/dist/src/components/form/two-factor-setup/setup-screen.d.cts +2 -0
  24. package/dist/src/components/form/two-factor-setup/setup-screen.d.ts +2 -0
  25. package/dist/src/components/form/two-factor-setup/setup-screen.d.ts.map +1 -1
  26. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.cts +1 -1
  27. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts +1 -1
  28. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts.map +1 -1
  29. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.cts +2 -0
  30. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts +2 -0
  31. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts.map +1 -1
  32. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.cts +2 -0
  33. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts +2 -0
  34. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts.map +1 -1
  35. package/dist/src/components/login-button/index.d.cts +54 -0
  36. package/dist/src/components/login-button/index.d.ts +54 -0
  37. package/dist/src/components/login-button/index.d.ts.map +1 -0
  38. package/dist/src/components/provider/passflow-provider.d.cts +4 -2
  39. package/dist/src/components/provider/passflow-provider.d.ts +4 -2
  40. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  41. package/dist/src/components/provider/upgrade-provider.d.cts +14 -1
  42. package/dist/src/components/provider/upgrade-provider.d.ts +14 -1
  43. package/dist/src/components/provider/upgrade-provider.d.ts.map +1 -1
  44. package/dist/src/components/ui/fields/field-password.d.ts.map +1 -1
  45. package/dist/src/components/ui/fields/field-phone.d.ts.map +1 -1
  46. package/dist/src/components/ui/index.d.cts +1 -0
  47. package/dist/src/components/ui/index.d.ts +1 -0
  48. package/dist/src/components/ui/index.d.ts.map +1 -1
  49. package/dist/src/components/ui/login-button/index.d.cts +2 -0
  50. package/dist/src/components/ui/login-button/index.d.ts +2 -0
  51. package/dist/src/components/ui/login-button/index.d.ts.map +1 -0
  52. package/dist/src/components/ui/login-button/login-button.d.cts +36 -0
  53. package/dist/src/components/ui/login-button/login-button.d.ts +36 -0
  54. package/dist/src/components/ui/login-button/login-button.d.ts.map +1 -0
  55. package/dist/src/components/ui/login-button/shadcn-theme.d.cts +23 -0
  56. package/dist/src/components/ui/login-button/shadcn-theme.d.ts +23 -0
  57. package/dist/src/components/ui/login-button/shadcn-theme.d.ts.map +1 -0
  58. package/dist/src/components/ui/login-button/use-shadcn-theme.d.cts +9 -0
  59. package/dist/src/components/ui/login-button/use-shadcn-theme.d.ts +9 -0
  60. package/dist/src/components/ui/login-button/use-shadcn-theme.d.ts.map +1 -0
  61. package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -1
  62. package/dist/src/components/ui/login-screen/shared.d.ts.map +1 -1
  63. package/dist/src/components/ui/login-screen/two-factor-code.d.cts +2 -1
  64. package/dist/src/components/ui/login-screen/two-factor-code.d.ts +2 -1
  65. package/dist/src/components/ui/login-screen/two-factor-code.d.ts.map +1 -1
  66. package/dist/src/components/ui/login-screen/types.d.cts +2 -1
  67. package/dist/src/components/ui/login-screen/types.d.ts +2 -1
  68. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
  69. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.cts +9 -3
  70. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts +9 -3
  71. package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts.map +1 -1
  72. package/dist/src/components/ui/upgrade-dialog/status.d.ts.map +1 -1
  73. package/dist/src/components/ui/upgrade-dialog/types.d.cts +6 -2
  74. package/dist/src/components/ui/upgrade-dialog/types.d.ts +6 -2
  75. package/dist/src/components/ui/upgrade-dialog/types.d.ts.map +1 -1
  76. package/dist/src/context/auth-context.d.cts +8 -2
  77. package/dist/src/context/auth-context.d.ts +8 -2
  78. package/dist/src/context/auth-context.d.ts.map +1 -1
  79. package/dist/src/context/upgrade-context.d.cts +1 -1
  80. package/dist/src/context/upgrade-context.d.ts +1 -1
  81. package/dist/src/context/upgrade-context.d.ts.map +1 -1
  82. package/dist/src/dev-account.d.cts +2 -0
  83. package/dist/src/dev-account.d.ts +2 -0
  84. package/dist/src/dev-account.d.ts.map +1 -0
  85. package/dist/src/dev-step-up.d.cts +2 -0
  86. package/dist/src/dev-step-up.d.ts +2 -0
  87. package/dist/src/dev-step-up.d.ts.map +1 -0
  88. package/dist/src/dev-two-factor-challenge.d.cts +2 -0
  89. package/dist/src/dev-two-factor-challenge.d.ts +2 -0
  90. package/dist/src/dev-two-factor-challenge.d.ts.map +1 -0
  91. package/dist/src/hooks/index.d.cts +3 -1
  92. package/dist/src/hooks/index.d.ts +3 -1
  93. package/dist/src/hooks/index.d.ts.map +1 -1
  94. package/dist/src/hooks/use-logout.d.cts +3 -1
  95. package/dist/src/hooks/use-logout.d.ts +3 -1
  96. package/dist/src/hooks/use-logout.d.ts.map +1 -1
  97. package/dist/src/hooks/use-signin.d.cts +19 -2
  98. package/dist/src/hooks/use-signin.d.ts +19 -2
  99. package/dist/src/hooks/use-signin.d.ts.map +1 -1
  100. package/dist/src/hooks/use-signup.d.cts +6 -1
  101. package/dist/src/hooks/use-signup.d.ts +6 -1
  102. package/dist/src/hooks/use-signup.d.ts.map +1 -1
  103. package/dist/src/hooks/use-two-factor-enrollment.d.cts +1 -0
  104. package/dist/src/hooks/use-two-factor-enrollment.d.ts +1 -0
  105. package/dist/src/hooks/use-two-factor-enrollment.d.ts.map +1 -1
  106. package/dist/src/hooks/use-two-factor-setup.d.cts +4 -1
  107. package/dist/src/hooks/use-two-factor-setup.d.ts +4 -1
  108. package/dist/src/hooks/use-two-factor-setup.d.ts.map +1 -1
  109. package/dist/src/hooks/use-user.d.cts +10 -0
  110. package/dist/src/hooks/use-user.d.ts +10 -0
  111. package/dist/src/hooks/use-user.d.ts.map +1 -0
  112. package/dist/src/index.d.cts +1 -0
  113. package/dist/src/index.d.ts +1 -0
  114. package/dist/src/index.d.ts.map +1 -1
  115. package/dist/src/utils/auth-error.d.cts +6 -0
  116. package/dist/src/utils/auth-error.d.ts +6 -0
  117. package/dist/src/utils/auth-error.d.ts.map +1 -1
  118. package/dist/src/utils/index.d.cts +1 -1
  119. package/dist/src/utils/index.d.ts +1 -1
  120. package/dist/src/utils/index.d.ts.map +1 -1
  121. package/dist/src/utils/url-params.d.ts.map +1 -1
  122. package/dist/src/utils/validation-schemas/index.d.ts.map +1 -1
  123. package/dist/style.css +1 -1
  124. package/package.json +2 -2
@@ -0,0 +1,5 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ export declare const PassflowProviderWrapper: FC<PropsWithChildren>;
3
+ export declare const App: () => import("react").JSX.Element;
4
+ export default App;
5
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ export declare const PassflowProviderWrapper: FC<PropsWithChildren>;
3
+ export declare const App: () => import("react").JSX.Element;
4
+ export default App;
5
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAWnD,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,iBAAiB,CAYzD,CAAC;AAEF,eAAO,MAAM,GAAG,mCAIf,CAAC;eAEa,GAAG"}
@@ -1,5 +1,7 @@
1
1
  export { ConsentFlow } from './consent/index.cjs';
2
2
  export { DeviceVerifyFlow } from './device-verify/index.cjs';
3
3
  export { PassflowFlow, type PassflowFlowLocation, type PassflowFlowNavigate, type PassflowProps } from './passflow/index.cjs';
4
+ export { TwoFactorSetupFlow, type TwoFactorSetupFlowProps } from './two-factor-setup/index.cjs';
4
5
  export { TwoFactorSetupMagicLinkFlow, type TwoFactorSetupMagicLinkFlowProps } from './two-factor-setup-magic-link/index.cjs';
6
+ export { TwoFactorVerifyFlow, type TwoFactorVerifyFlowProps } from './two-factor-verify/index.cjs';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,7 @@
1
1
  export { ConsentFlow } from './consent/index.js';
2
2
  export { DeviceVerifyFlow } from './device-verify/index.js';
3
3
  export { PassflowFlow, type PassflowFlowLocation, type PassflowFlowNavigate, type PassflowProps } from './passflow/index.js';
4
+ export { TwoFactorSetupFlow, type TwoFactorSetupFlowProps } from './two-factor-setup/index.js';
4
5
  export { TwoFactorSetupMagicLinkFlow, type TwoFactorSetupMagicLinkFlowProps } from './two-factor-setup-magic-link/index.js';
6
+ export { TwoFactorVerifyFlow, type TwoFactorVerifyFlowProps } from './two-factor-verify/index.js';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,KAAK,gCAAgC,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,KAAK,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,10 +1,9 @@
1
1
  import type { FC } from 'react';
2
2
  import type { SuccessAuthRedirect } from '../../../types/index.cjs';
3
- type TwoFactorSetupFlowProps = {
3
+ export type TwoFactorSetupFlowProps = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  twoFactorVerifyPath?: string;
6
6
  signInPath?: string;
7
7
  };
8
8
  export declare const TwoFactorSetupFlow: FC<TwoFactorSetupFlowProps>;
9
- export {};
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,9 @@
1
1
  import type { FC } from 'react';
2
2
  import type { SuccessAuthRedirect } from '../../../types/index.js';
3
- type TwoFactorSetupFlowProps = {
3
+ export type TwoFactorSetupFlowProps = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  twoFactorVerifyPath?: string;
6
6
  signInPath?: string;
7
7
  };
8
8
  export declare const TwoFactorSetupFlow: FC<TwoFactorSetupFlowProps>;
9
- export {};
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/two-factor-setup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,OAAO,oBAAoB,CAAC;AAE5B,KAAK,uBAAuB,GAAG;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA+C1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/two-factor-setup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA+C1D,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { SuccessAuthRedirect } from '../../../types/index.cjs';
3
- type TwoFactorVerifyFlowProps = {
3
+ export type TwoFactorVerifyFlowProps = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  signInPath?: string;
6
6
  };
7
7
  export declare const TwoFactorVerifyFlow: FC<TwoFactorVerifyFlowProps>;
8
- export {};
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,8 @@
1
1
  import type { FC } from 'react';
2
2
  import type { SuccessAuthRedirect } from '../../../types/index.js';
3
- type TwoFactorVerifyFlowProps = {
3
+ export type TwoFactorVerifyFlowProps = {
4
4
  successAuthRedirect?: SuccessAuthRedirect;
5
5
  signInPath?: string;
6
6
  };
7
7
  export declare const TwoFactorVerifyFlow: FC<TwoFactorVerifyFlowProps>;
8
- export {};
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/two-factor-verify/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAShC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,OAAO,oBAAoB,CAAC;AAE5B,KAAK,wBAAwB,GAAG;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAmE5D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/two-factor-verify/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAShC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,wBAAwB,GAAG;IACrC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAsE5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/forgot-password/forgot-password.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AASzC,OAAO,oBAAoB,CAAC;AAY5B,KAAK,eAAe,GAAG;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,eAAe,CAiM9C,CAAC"}
1
+ {"version":3,"file":"forgot-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/forgot-password/forgot-password.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AAiBzC,OAAO,oBAAoB,CAAC;AAO5B,KAAK,eAAe,GAAG;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,eAAe,CAkM9C,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;AAehC,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;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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;AAehC,OAAO,KAAK,EAAiB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAqDpF,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,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,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,CA8NlC,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;AAehC,OAAO,KAAK,EAAiB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAqDpF,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,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,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,CAgOlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-challenge/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,KAAK,uBAAuB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAgL1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-challenge/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,KAAK,uBAAuB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAyL1D,CAAC"}
@@ -23,6 +23,8 @@ type RecoveryCodesScreenProps = SetupScreenStatus & {
23
23
  };
24
24
  /** Direct enrolment and the setup link page share these, so both look the same. */
25
25
  export declare const getTwoFactorSetupStartScreen: ({ busy, error, secondaryAction, onStart, }: StartScreenProps) => LoginScreenProps;
26
+ /** A user with two-factor authentication on: shown instead of the start step. */
27
+ export declare const getTwoFactorSetupEnrolledScreen: () => LoginScreenProps;
26
28
  export declare const getTwoFactorSetupCodeScreen: ({ data, fallbackDigits, notice, busy, error, secondaryAction, onSubmit, }: CodeScreenProps) => LoginScreenProps;
27
29
  export declare const getTwoFactorRecoveryCodesScreen: ({ codes, busy, error, onContinue, }: RecoveryCodesScreenProps) => LoginScreenProps;
28
30
  export {};
@@ -23,6 +23,8 @@ type RecoveryCodesScreenProps = SetupScreenStatus & {
23
23
  };
24
24
  /** Direct enrolment and the setup link page share these, so both look the same. */
25
25
  export declare const getTwoFactorSetupStartScreen: ({ busy, error, secondaryAction, onStart, }: StartScreenProps) => LoginScreenProps;
26
+ /** A user with two-factor authentication on: shown instead of the start step. */
27
+ export declare const getTwoFactorSetupEnrolledScreen: () => LoginScreenProps;
26
28
  export declare const getTwoFactorSetupCodeScreen: ({ data, fallbackDigits, notice, busy, error, secondaryAction, onSubmit, }: CodeScreenProps) => LoginScreenProps;
27
29
  export declare const getTwoFactorRecoveryCodesScreen: ({ codes, busy, error, onContinue, }: RecoveryCodesScreenProps) => LoginScreenProps;
28
30
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"setup-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-setup/setup-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAI3E,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,gBAAgB,GAAG,iBAAiB,GAAG;IAC1C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG,iBAAiB,GAAG;IACzC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,KAAK,wBAAwB,GAAG,iBAAiB,GAAG;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,+CAKtC,gBAAgB,KAAG,gBAgBpB,CAAC;AAEH,eAAO,MAAM,2BAA2B,8EAQrC,eAAe,KAAG,gBAiCpB,CAAC;AAEF,eAAO,MAAM,+BAA+B,wCAKzC,wBAAwB,KAAG,gBAkB5B,CAAC"}
1
+ {"version":3,"file":"setup-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-setup/setup-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAI3E,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,gBAAgB,GAAG,iBAAiB,GAAG;IAC1C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG,iBAAiB,GAAG;IACzC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,KAAK,wBAAwB,GAAG,iBAAiB,GAAG;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,+CAKtC,gBAAgB,KAAG,gBAgBpB,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,+BAA+B,QAAO,gBASjD,CAAC;AAEH,eAAO,MAAM,2BAA2B,8EAQrC,eAAe,KAAG,gBAiCpB,CAAC;AAEF,eAAO,MAAM,+BAA+B,wCAKzC,wBAAwB,KAAG,gBAkB5B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  type TwoFactorSetupFormProps = {
3
3
  onComplete?: (recoveryCodes: string[]) => void;
4
4
  /** The way out of the first step only. */
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  type TwoFactorSetupFormProps = {
3
3
  onComplete?: (recoveryCodes: string[]) => void;
4
4
  /** The way out of the first step only. */
@@ -1 +1 @@
1
- {"version":3,"file":"two-factor-setup-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-setup/two-factor-setup-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,oBAAoB,CAAC;AAE5B,KAAK,uBAAuB,GAAG;IAC7B,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAiD1D,CAAC"}
1
+ {"version":3,"file":"two-factor-setup-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-setup/two-factor-setup-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAWnD,OAAO,oBAAoB,CAAC;AAE5B,KAAK,uBAAuB,GAAG;IAC7B,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA2D1D,CAAC"}
@@ -10,6 +10,8 @@ type TwoFactorRecoveryFormProps = {
10
10
  subtitle?: string;
11
11
  /** Label of the "trust this device" option, unticked by default. */
12
12
  trustDeviceLabel?: string;
13
+ /** The server's `device_trust_available` for this sign-in. Only `false` hides the option; absent shows it. */
14
+ deviceTrustAvailable?: boolean;
13
15
  };
14
16
  export declare const TwoFactorRecoveryForm: FC<TwoFactorRecoveryFormProps>;
15
17
  export {};
@@ -10,6 +10,8 @@ type TwoFactorRecoveryFormProps = {
10
10
  subtitle?: string;
11
11
  /** Label of the "trust this device" option, unticked by default. */
12
12
  trustDeviceLabel?: string;
13
+ /** The server's `device_trust_available` for this sign-in. Only `false` hides the option; absent shows it. */
14
+ deviceTrustAvailable?: boolean;
13
15
  };
14
16
  export declare const TwoFactorRecoveryForm: FC<TwoFactorRecoveryFormProps>;
15
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"two-factor-recovery-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-verify/two-factor-recovery-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAU7D,OAAO,oBAAoB,CAAC;AAE5B,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAKF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CA+DhE,CAAC"}
1
+ {"version":3,"file":"two-factor-recovery-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-verify/two-factor-recovery-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAU7D,OAAO,oBAAoB,CAAC;AAE5B,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8GAA8G;IAC9G,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAKF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAmEhE,CAAC"}
@@ -12,6 +12,8 @@ type TwoFactorVerifyFormProps = {
12
12
  shouldAutoFocus?: boolean;
13
13
  /** Label of the "trust this device" option, unticked by default. */
14
14
  trustDeviceLabel?: string;
15
+ /** The server's `device_trust_available` for this sign-in. Only `false` hides the option; absent shows it. */
16
+ deviceTrustAvailable?: boolean;
15
17
  };
16
18
  export declare const TwoFactorVerifyForm: FC<TwoFactorVerifyFormProps>;
17
19
  export {};
@@ -12,6 +12,8 @@ type TwoFactorVerifyFormProps = {
12
12
  shouldAutoFocus?: boolean;
13
13
  /** Label of the "trust this device" option, unticked by default. */
14
14
  trustDeviceLabel?: string;
15
+ /** The server's `device_trust_available` for this sign-in. Only `false` hides the option; absent shows it. */
16
+ deviceTrustAvailable?: boolean;
15
17
  };
16
18
  export declare const TwoFactorVerifyForm: FC<TwoFactorVerifyFormProps>;
17
19
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"two-factor-verify-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-verify/two-factor-verify-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAK7D,OAAO,oBAAoB,CAAC;AAE5B,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,2HAA2H;IAC3H,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAKF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAwE5D,CAAC"}
1
+ {"version":3,"file":"two-factor-verify-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/two-factor-verify/two-factor-verify-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAK7D,OAAO,oBAAoB,CAAC;AAE5B,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,2HAA2H;IAC3H,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8GAA8G;IAC9G,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAKF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA6E5D,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { AuthRedirectOptions } from '@passflow/core';
2
+ import { type FC, type ReactElement, type ReactNode } from 'react';
3
+ import { type LoginButtonAppearance } from '../ui/login-button/index.cjs';
4
+ import { type PassflowUser } from '../../hooks/use-user.cjs';
5
+ /** What a function child of `LoginButton` receives. */
6
+ export type LoginButtonRenderProps = {
7
+ isSignedIn: boolean;
8
+ /** The label the default button would show now: `signInLabel`, or the signed-in label. */
9
+ label: ReactNode;
10
+ user: PassflowUser;
11
+ /** True while the sign-out is in flight; a click then does nothing. */
12
+ busy: boolean;
13
+ };
14
+ export type LoginButtonProps = {
15
+ /** Shown while signed out. Default "Sign in". */
16
+ signInLabel?: ReactNode;
17
+ /** Shown while signed in. Default: the user's email, else the phone, else "Sign out". */
18
+ signedInLabel?: (user: PassflowUser) => ReactNode;
19
+ /** Read by assistive technology after the signed-in label, since a click signs out. Default "Sign out". */
20
+ signOutDescription?: string;
21
+ /** Passed to `passflow.authRedirect()` on sign-in. */
22
+ authRedirectOptions?: AuthRedirectOptions;
23
+ /** After a hosted sign-in: where the hosted login sends the browser once signed out. */
24
+ postLogoutRedirectUri?: string;
25
+ /** The look of the default button. Default `passflow`; `shadcn` follows the host app's shadcn/ui theme. */
26
+ appearance?: LoginButtonAppearance;
27
+ /**
28
+ * Your own element as the button, in place of the default one. It is cloned
29
+ * with a click handler that first calls its own `onClick`, then signs in or
30
+ * out unless that called `event.preventDefault()`. A child that calls
31
+ * `onClick()` with no event still signs in or out. Its content is kept as it
32
+ * is: no label is injected. While the sign-out is in flight it gets
33
+ * `disabled` and `aria-busy`; otherwise those stay as you passed them. For a
34
+ * label that switches, pass a function that returns the element; it also
35
+ * receives `busy`.
36
+ */
37
+ children?: ReactElement | ((props: LoginButtonRenderProps) => ReactElement);
38
+ };
39
+ /**
40
+ * One button that signs in or out. Signed out, a click starts the hosted
41
+ * sign-in (`passflow.authRedirect()`); signed in, it shows who is signed in and
42
+ * a click signs out (`useAuth().logout()`). It switches on sign-in and
43
+ * sign-out events.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <LoginButton />
48
+ * <LoginButton appearance='shadcn' postLogoutRedirectUri='https://app.example.com/' />
49
+ * <LoginButton><MyButton>Account</MyButton></LoginButton>
50
+ * <LoginButton>{({ label }) => <MyButton>{label}</MyButton>}</LoginButton>
51
+ * ```
52
+ */
53
+ export declare const LoginButton: FC<LoginButtonProps>;
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,54 @@
1
+ import type { AuthRedirectOptions } from '@passflow/core';
2
+ import { type FC, type ReactElement, type ReactNode } from 'react';
3
+ import { type LoginButtonAppearance } from '../ui/login-button/index.js';
4
+ import { type PassflowUser } from '../../hooks/use-user.js';
5
+ /** What a function child of `LoginButton` receives. */
6
+ export type LoginButtonRenderProps = {
7
+ isSignedIn: boolean;
8
+ /** The label the default button would show now: `signInLabel`, or the signed-in label. */
9
+ label: ReactNode;
10
+ user: PassflowUser;
11
+ /** True while the sign-out is in flight; a click then does nothing. */
12
+ busy: boolean;
13
+ };
14
+ export type LoginButtonProps = {
15
+ /** Shown while signed out. Default "Sign in". */
16
+ signInLabel?: ReactNode;
17
+ /** Shown while signed in. Default: the user's email, else the phone, else "Sign out". */
18
+ signedInLabel?: (user: PassflowUser) => ReactNode;
19
+ /** Read by assistive technology after the signed-in label, since a click signs out. Default "Sign out". */
20
+ signOutDescription?: string;
21
+ /** Passed to `passflow.authRedirect()` on sign-in. */
22
+ authRedirectOptions?: AuthRedirectOptions;
23
+ /** After a hosted sign-in: where the hosted login sends the browser once signed out. */
24
+ postLogoutRedirectUri?: string;
25
+ /** The look of the default button. Default `passflow`; `shadcn` follows the host app's shadcn/ui theme. */
26
+ appearance?: LoginButtonAppearance;
27
+ /**
28
+ * Your own element as the button, in place of the default one. It is cloned
29
+ * with a click handler that first calls its own `onClick`, then signs in or
30
+ * out unless that called `event.preventDefault()`. A child that calls
31
+ * `onClick()` with no event still signs in or out. Its content is kept as it
32
+ * is: no label is injected. While the sign-out is in flight it gets
33
+ * `disabled` and `aria-busy`; otherwise those stay as you passed them. For a
34
+ * label that switches, pass a function that returns the element; it also
35
+ * receives `busy`.
36
+ */
37
+ children?: ReactElement | ((props: LoginButtonRenderProps) => ReactElement);
38
+ };
39
+ /**
40
+ * One button that signs in or out. Signed out, a click starts the hosted
41
+ * sign-in (`passflow.authRedirect()`); signed in, it shows who is signed in and
42
+ * a click signs out (`useAuth().logout()`). It switches on sign-in and
43
+ * sign-out events.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <LoginButton />
48
+ * <LoginButton appearance='shadcn' postLogoutRedirectUri='https://app.example.com/' />
49
+ * <LoginButton><MyButton>Account</MyButton></LoginButton>
50
+ * <LoginButton>{({ label }) => <MyButton>{label}</MyButton>}</LoginButton>
51
+ * ```
52
+ */
53
+ export declare const LoginButton: FC<LoginButtonProps>;
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/login-button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,8BAA8B,CAAC;AAG3F,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAE9D,uDAAuD;AACvD,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,0FAA0F;IAC1F,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,uEAAuE;IACvE,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iDAAiD;IACjD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,yFAAyF;IACzF,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,SAAS,CAAC;IAClD,2GAA2G;IAC3G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2GAA2G;IAC3G,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,KAAK,EAAE,sBAAsB,KAAK,YAAY,CAAC,CAAC;CAC7E,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAwC5C,CAAC"}
@@ -12,7 +12,7 @@ export { readParentChallengeIdFromURL };
12
12
  * act, not a nested detail) and `enabled` is derived from `upgrade`/`backend`
13
13
  * below, so there is exactly one source for each.
14
14
  */
15
- export type PassflowUpgradeOptions = Omit<UpgradeProviderProps, 'children' | 'enabled' | 'backend'>;
15
+ export type PassflowUpgradeOptions = Omit<UpgradeProviderProps, 'children' | 'enabled' | 'backend' | 'failures'>;
16
16
  type PassflowProviderProps = PassflowConfig & {
17
17
  /** See `PassflowConfig`. Read once, when the provider mounts. */
18
18
  keyStoragePrefix?: PassflowConfig['keyStoragePrefix'];
@@ -134,8 +134,10 @@ type ParentChallengeMeta = {
134
134
  * - `upgrade_required`: the hosted session needs a step-up before it can be
135
135
  * exchanged, and the step-up dialog is open.
136
136
  * - `fallback_to_login`: no usable hosted session; the sign-in form renders.
137
+ * - `unsatisfiable`: no factor of this account reaches the level; the page says so, with no form.
138
+ * - `rate_limited`: the step-up hit the server's rate limit; the page says how long to wait, with no form.
137
139
  */
138
- type ExchangeState = 'idle' | 'exchanging' | 'upgrade_required' | 'fallback_to_login';
140
+ type ExchangeState = 'idle' | 'exchanging' | 'upgrade_required' | 'fallback_to_login' | 'unsatisfiable' | 'rate_limited';
139
141
  /**
140
142
  * Context surface exposed to children so the SDK's own components
141
143
  * (or consumer code) can read the OIDC parent-challenge state.
@@ -12,7 +12,7 @@ export { readParentChallengeIdFromURL };
12
12
  * act, not a nested detail) and `enabled` is derived from `upgrade`/`backend`
13
13
  * below, so there is exactly one source for each.
14
14
  */
15
- export type PassflowUpgradeOptions = Omit<UpgradeProviderProps, 'children' | 'enabled' | 'backend'>;
15
+ export type PassflowUpgradeOptions = Omit<UpgradeProviderProps, 'children' | 'enabled' | 'backend' | 'failures'>;
16
16
  type PassflowProviderProps = PassflowConfig & {
17
17
  /** See `PassflowConfig`. Read once, when the provider mounts. */
18
18
  keyStoragePrefix?: PassflowConfig['keyStoragePrefix'];
@@ -134,8 +134,10 @@ type ParentChallengeMeta = {
134
134
  * - `upgrade_required`: the hosted session needs a step-up before it can be
135
135
  * exchanged, and the step-up dialog is open.
136
136
  * - `fallback_to_login`: no usable hosted session; the sign-in form renders.
137
+ * - `unsatisfiable`: no factor of this account reaches the level; the page says so, with no form.
138
+ * - `rate_limited`: the step-up hit the server's rate limit; the page says how long to wait, with no form.
137
139
  */
138
- type ExchangeState = 'idle' | 'exchanging' | 'upgrade_required' | 'fallback_to_login';
140
+ type ExchangeState = 'idle' | 'exchanging' | 'upgrade_required' | 'fallback_to_login' | 'unsatisfiable' | 'rate_limited';
139
141
  /**
140
142
  * Context surface exposed to children so the SDK's own components
141
143
  * (or consumer code) can read the OIDC parent-challenge state.
@@ -1 +1 @@
1
- {"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EAMpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAGpG,OAAO,EAKL,KAAK,OAAO,EAEZ,KAAK,gBAAgB,EAKrB,KAAK,UAAU,EAEhB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpG,KAAK,qBAA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EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,KAAK,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,eAAe,GAAG,cAAc,CAAC;AA2OzH;;;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;AA4IF,eAAO,MAAM,mBAAmB,yCAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0QtD,CAAC"}
@@ -33,7 +33,9 @@
33
33
  * controller on `SignIn` / `SignOut`; this provider discards its view of it in
34
34
  * the same breath, and the waiter that was mid-flight settles as
35
35
  * `session changed`, which the hook reports as `idle` — nothing that did not
36
- * happen is reported as though it had.
36
+ * happen is reported as though it had. The hosted step-up
37
+ * (`passflow.hostedUpgrade`) is bound to the hosted session cookie instead, so
38
+ * the instance's `SignIn` / `SignOut` leave its prompt open.
37
39
  */
38
40
  import { type ReplayPolicy, type UpgradeDiagnosticSink, type UpgradeFacade, type UpgradeFactor } from '@passflow/core';
39
41
  import { type FC, type ReactElement, type ReactNode } from 'react';
@@ -74,6 +76,17 @@ export type UpgradeProviderProps = {
74
76
  /** Per-factor wording for the dialog. */
75
77
  labels?: UpgradeDialogLabels;
76
78
  title?: string;
79
+ /**
80
+ * Where a step-up that only a fresh sign-in can meet sends the user, and the "Sign in again" action of an
81
+ * insufficient one. Called once, with the dialog closed; nothing is retried. Default: `passflow.authRedirect()`.
82
+ */
83
+ onSignInRequired?: () => void;
84
+ /**
85
+ * Who shows how a failed step-up ended. `'dialog'` (default): the dialog's own panels, and sign-in required calls
86
+ * `onSignInRequired`. `'caller'`: the dialog closes and the caller of `elevate` shows it from the rejection, as the
87
+ * hosted login page does.
88
+ */
89
+ failures?: 'dialog' | 'caller';
77
90
  /**
78
91
  * FR5's render-prop override. It receives the **exact** props the built-in
79
92
  * dialog would render — a typed, constrained override with no `className` or
@@ -33,7 +33,9 @@
33
33
  * controller on `SignIn` / `SignOut`; this provider discards its view of it in
34
34
  * the same breath, and the waiter that was mid-flight settles as
35
35
  * `session changed`, which the hook reports as `idle` — nothing that did not
36
- * happen is reported as though it had.
36
+ * happen is reported as though it had. The hosted step-up
37
+ * (`passflow.hostedUpgrade`) is bound to the hosted session cookie instead, so
38
+ * the instance's `SignIn` / `SignOut` leave its prompt open.
37
39
  */
38
40
  import { type ReplayPolicy, type UpgradeDiagnosticSink, type UpgradeFacade, type UpgradeFactor } from '@passflow/core';
39
41
  import { type FC, type ReactElement, type ReactNode } from 'react';
@@ -74,6 +76,17 @@ export type UpgradeProviderProps = {
74
76
  /** Per-factor wording for the dialog. */
75
77
  labels?: UpgradeDialogLabels;
76
78
  title?: string;
79
+ /**
80
+ * Where a step-up that only a fresh sign-in can meet sends the user, and the "Sign in again" action of an
81
+ * insufficient one. Called once, with the dialog closed; nothing is retried. Default: `passflow.authRedirect()`.
82
+ */
83
+ onSignInRequired?: () => void;
84
+ /**
85
+ * Who shows how a failed step-up ended. `'dialog'` (default): the dialog's own panels, and sign-in required calls
86
+ * `onSignInRequired`. `'caller'`: the dialog closes and the caller of `elevate` shows it from the rejection, as the
87
+ * hosted login page does.
88
+ */
89
+ failures?: 'dialog' | 'caller';
77
90
  /**
78
91
  * FR5's render-prop override. It receives the **exact** props the built-in
79
92
  * dialog would render — a typed, constrained override with no `className` or
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/upgrade-provider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,aAAa,EAOnB,MAAM,gBAAgB,CA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AAQ,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,YAAY,GAAG,IAAI,CAAC;CACnE,CAAC;AAsHF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAyYpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"field-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-password.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,mBAAmB,EAAY,MAAM,OAAO,CAAC;AAEvE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AA+BrE,eAAO,MAAM,aAAa;QA3BpB,MAAM;WACH,MAAM;oBACG,8BAA8B,GAAG,IAAI;mBACtC,OAAO;uBACH,MAAM,GAAG,MAAM,EAAE;cAC1B,OAAO;gBACL,MAAM;eACP,OAAO;oDA+HnB,CAAC"}
1
+ {"version":3,"file":"field-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-password.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,mBAAmB,EAAY,MAAM,OAAO,CAAC;AAEvE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAiCrE,eAAO,MAAM,aAAa;QA7BpB,MAAM;WACH,MAAM;oBACG,8BAA8B,GAAG,IAAI;mBACtC,OAAO;uBACH,MAAM,GAAG,MAAM,EAAE;cAC1B,OAAO;gBACL,MAAM;eACP,OAAO;oDA0InB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"field-phone.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-phone.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,EAAE,EACP,KAAK,mBAAmB,EAMzB,MAAM,OAAO,CAAC;AAMf,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,WAAW,CAuNtC,CAAC"}
1
+ {"version":3,"file":"field-phone.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-phone.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,EAAE,EACP,KAAK,mBAAmB,EAMzB,MAAM,OAAO,CAAC;AAMf,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,WAAW,CAsOtC,CAAC"}
@@ -5,6 +5,7 @@ export * from './dialog/index.cjs';
5
5
  export * from './fields/index.cjs';
6
6
  export { Icon } from './icon/index.cjs';
7
7
  export { Link } from './link/index.cjs';
8
+ export { type LoginButtonAppearance, LoginButtonView, type LoginButtonViewProps, type LoginButtonViewState, } from './login-button/index.cjs';
8
9
  export * from './login-screen/index.cjs';
9
10
  export * from './popover/index.cjs';
10
11
  export * from './providers-box/index.cjs';
@@ -5,6 +5,7 @@ export * from './dialog/index.js';
5
5
  export * from './fields/index.js';
6
6
  export { Icon } from './icon/index.js';
7
7
  export { Link } from './link/index.js';
8
+ export { type LoginButtonAppearance, LoginButtonView, type LoginButtonViewProps, type LoginButtonViewState, } from './login-button/index.js';
8
9
  export * from './login-screen/index.js';
9
10
  export * from './popover/index.js';
10
11
  export * from './providers-box/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,oBAAoB,EACpB,aAAa,EACb,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,mBAAmB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AC7B,oBAAoB,EACpB,aAAa,EACb,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,aAAa,EACb,KAAK,kBAAkB,EACvB,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { type LoginButtonAppearance, LoginButtonView, type LoginButtonViewProps, type LoginButtonViewState, } from './login-button.cjs';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { type LoginButtonAppearance, LoginButtonView, type LoginButtonViewProps, type LoginButtonViewState, } from './login-button.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type FC, type ReactElement, type ReactNode } from 'react';
2
+ /**
3
+ * `passflow` is the Passflow look. `shadcn` takes the colours, radius, focus
4
+ * ring and font from the host app's shadcn/ui variables (`--primary`,
5
+ * `--primary-foreground`, `--radius`, `--ring`, `--font-sans`), in either the
6
+ * HSL-triplet or the complete-colour format, and falls back to the Passflow
7
+ * tokens for any that are missing.
8
+ */
9
+ export type LoginButtonAppearance = 'passflow' | 'shadcn';
10
+ /** `signing-out` is the signed-in button while the sign-out is in flight: disabled and busy. */
11
+ export type LoginButtonViewState = 'signed-out' | 'signed-in' | 'signing-out';
12
+ export type LoginButtonViewProps = {
13
+ state: LoginButtonViewState;
14
+ /** The visible content of the default button. Ignored when `children` is given. */
15
+ label: ReactNode;
16
+ /** Read by assistive technology after the name while signed in, since clicking signs out. */
17
+ signOutDescription?: string;
18
+ appearance?: LoginButtonAppearance;
19
+ /** The sign-in or sign-out. Not called when a wrapped child's own `onClick` calls `preventDefault()`. */
20
+ onClick: () => void;
21
+ /**
22
+ * The app's own element to use as the button instead of the default one. It
23
+ * is cloned with a click handler and otherwise left as it is: its props,
24
+ * content and look are its own, and no label is injected. While signing out
25
+ * it also gets `disabled` and `aria-busy`; when idle those stay as the app
26
+ * passed them.
27
+ */
28
+ children?: ReactElement;
29
+ };
30
+ /**
31
+ * The sign-in / sign-out button. It renders a state and calls `onClick`; the
32
+ * `LoginButton` runtime component decides the state and does the sign-in or
33
+ * sign-out.
34
+ */
35
+ export declare const LoginButtonView: FC<LoginButtonViewProps>;
36
+ //# sourceMappingURL=login-button.d.ts.map