@passflow/react 0.13.0 → 0.15.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.
- package/CHANGELOG.md +43 -0
- package/README.md +21 -8
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.es.js +146 -143
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/error/index.d.cts +7 -0
- package/dist/src/components/error/index.d.ts +1 -1
- package/dist/src/components/error/index.d.ts.map +1 -1
- package/dist/src/components/flow/consent/index.d.cts +13 -0
- package/dist/src/components/flow/consent/index.d.ts +1 -1
- package/dist/src/components/flow/consent/index.d.ts.map +1 -1
- package/dist/src/components/flow/consent/screen.d.cts +9 -0
- package/dist/src/components/flow/consent/screen.d.ts +2 -2
- package/dist/src/components/flow/consent/screen.d.ts.map +1 -1
- package/dist/src/components/flow/device-verify/index.d.cts +10 -0
- package/dist/src/components/flow/device-verify/index.d.ts +1 -1
- package/dist/src/components/flow/device-verify/index.d.ts.map +1 -1
- package/dist/src/components/flow/device-verify/screen.d.cts +4 -0
- package/dist/src/components/flow/device-verify/screen.d.ts +2 -2
- package/dist/src/components/flow/device-verify/screen.d.ts.map +1 -1
- package/dist/src/components/flow/index.d.cts +5 -0
- package/dist/src/components/flow/index.d.ts +4 -4
- package/dist/src/components/flow/index.d.ts.map +1 -1
- package/dist/src/components/flow/passflow/index.d.cts +16 -0
- package/dist/src/components/flow/passflow/index.d.ts +5 -1
- package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
- package/dist/src/components/flow/two-factor-setup/index.d.cts +10 -0
- package/dist/src/components/flow/two-factor-setup/index.d.ts +2 -2
- package/dist/src/components/flow/two-factor-setup/index.d.ts.map +1 -1
- package/dist/src/components/flow/two-factor-setup-magic-link/index.d.cts +35 -0
- package/dist/src/components/flow/two-factor-setup-magic-link/index.d.ts +2 -2
- package/dist/src/components/flow/two-factor-setup-magic-link/index.d.ts.map +1 -1
- package/dist/src/components/flow/two-factor-verify/index.d.cts +11 -0
- package/dist/src/components/flow/two-factor-verify/index.d.ts +2 -2
- package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
- package/dist/src/components/form/forgot-password/forgot-password-success.d.cts +2 -0
- package/dist/src/components/form/forgot-password/forgot-password-success.d.ts +1 -1
- package/dist/src/components/form/forgot-password/forgot-password-success.d.ts.map +1 -1
- package/dist/src/components/form/forgot-password/forgot-password.d.cts +9 -0
- package/dist/src/components/form/forgot-password/forgot-password.d.ts +1 -1
- package/dist/src/components/form/forgot-password/forgot-password.d.ts.map +1 -1
- package/dist/src/components/form/forgot-password/index.d.cts +3 -0
- package/dist/src/components/form/forgot-password/index.d.ts +2 -2
- package/dist/src/components/form/index.d.cts +10 -0
- package/dist/src/components/form/index.d.ts +9 -9
- package/dist/src/components/form/index.d.ts.map +1 -1
- package/dist/src/components/form/invitation-join/index.d.cts +7 -0
- package/dist/src/components/form/invitation-join/index.d.ts +1 -2
- package/dist/src/components/form/invitation-join/index.d.ts.map +1 -1
- package/dist/src/components/form/reset-password/index.d.cts +9 -0
- package/dist/src/components/form/reset-password/index.d.ts +2 -2
- package/dist/src/components/form/reset-password/index.d.ts.map +1 -1
- package/dist/src/components/form/signin/index.d.cts +15 -0
- package/dist/src/components/form/signin/index.d.ts +2 -2
- package/dist/src/components/form/signin/index.d.ts.map +1 -1
- package/dist/src/components/form/signup/index.d.cts +14 -0
- package/dist/src/components/form/signup/index.d.ts +2 -2
- package/dist/src/components/form/signup/index.d.ts.map +1 -1
- package/dist/src/components/form/two-factor-challenge/index.d.cts +10 -0
- package/dist/src/components/form/two-factor-challenge/index.d.ts +1 -1
- package/dist/src/components/form/two-factor-challenge/index.d.ts.map +1 -1
- package/dist/src/components/form/two-factor-challenge/method-selector.d.cts +12 -0
- package/dist/src/components/form/two-factor-challenge/method-selector.d.ts +2 -2
- package/dist/src/components/form/two-factor-setup/index.d.cts +2 -0
- package/dist/src/components/form/two-factor-setup/index.d.ts +1 -1
- package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.cts +9 -0
- package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts +1 -1
- package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts.map +1 -1
- package/dist/src/components/form/two-factor-verify/index.d.cts +3 -0
- package/dist/src/components/form/two-factor-verify/index.d.ts +2 -2
- package/dist/src/components/form/two-factor-verify/index.d.ts.map +1 -1
- package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.cts +13 -0
- package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts +1 -1
- package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts.map +1 -1
- package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.cts +16 -0
- package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts +1 -1
- package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/index.d.cts +3 -0
- package/dist/src/components/form/verify-challenge/index.d.ts +2 -2
- package/dist/src/components/form/verify-challenge/timer-button.d.cts +9 -0
- package/dist/src/components/form/verify-challenge/timer-button.d.ts +1 -1
- package/dist/src/components/form/verify-challenge/timer-button.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.cts +2 -0
- package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.cts +16 -0
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.ts +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.cts +9 -0
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts +1 -2
- package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.cts +12 -0
- package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts +2 -2
- package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts.map +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-success.d.cts +3 -0
- package/dist/src/components/form/verify-challenge/verify-challenge-success.d.ts +1 -1
- package/dist/src/components/form/verify-challenge/verify-challenge-success.d.ts.map +1 -1
- package/dist/src/components/form/wrapper/index.d.cts +2 -0
- package/dist/src/components/form/wrapper/index.d.ts +1 -1
- package/dist/src/components/passkey/index.d.cts +7 -0
- package/dist/src/components/passkey/index.d.ts +1 -1
- package/dist/src/components/passkey/index.d.ts.map +1 -1
- package/dist/src/components/passkey/passkey-actions.d.cts +13 -0
- package/dist/src/components/passkey/passkey-actions.d.ts +1 -1
- package/dist/src/components/passkey/passkey-actions.d.ts.map +1 -1
- package/dist/src/components/passkey/passkey-dialog.d.cts +10 -0
- package/dist/src/components/passkey/passkey-dialog.d.ts +1 -1
- package/dist/src/components/passkey/passkey-list.d.cts +9 -0
- package/dist/src/components/passkey/passkey-list.d.ts +2 -2
- package/dist/src/components/passkey/passkey-list.d.ts.map +1 -1
- package/dist/src/components/provider/index.d.cts +4 -0
- package/dist/src/components/provider/index.d.ts +3 -3
- package/dist/src/components/provider/index.d.ts.map +1 -1
- package/dist/src/components/provider/passflow-provider.d.cts +160 -0
- package/dist/src/components/provider/passflow-provider.d.ts +24 -4
- package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
- package/dist/src/components/provider/upgrade-provider.d.cts +85 -0
- package/dist/src/components/provider/upgrade-provider.d.ts +39 -3
- package/dist/src/components/provider/upgrade-provider.d.ts.map +1 -1
- package/dist/src/components/ui/button/index.d.cts +34 -0
- package/dist/src/components/ui/button/index.d.ts +3 -2
- package/dist/src/components/ui/button/index.d.ts.map +1 -1
- package/dist/src/components/ui/continuing-status/index.d.cts +8 -0
- package/dist/src/components/ui/continuing-status/index.d.ts +8 -0
- package/dist/src/components/ui/continuing-status/index.d.ts.map +1 -0
- package/dist/src/components/ui/country-flag/index.d.cts +7 -0
- package/dist/src/components/ui/country-flag/index.d.ts +1 -1
- package/dist/src/components/ui/country-flag/index.d.ts.map +1 -1
- package/dist/src/components/ui/country-flag/positions.d.cts +245 -0
- package/dist/src/components/ui/country-flag/positions.d.ts +241 -241
- package/dist/src/components/ui/country-flag/positions.d.ts.map +1 -1
- package/dist/src/components/ui/dialog/index.d.cts +20 -0
- package/dist/src/components/ui/dialog/index.d.ts +18 -18
- package/dist/src/components/ui/dialog/index.d.ts.map +1 -1
- package/dist/src/components/ui/fields/field-otp.d.cts +35 -0
- package/dist/src/components/ui/fields/field-otp.d.ts +35 -0
- package/dist/src/components/ui/fields/field-otp.d.ts.map +1 -0
- package/dist/src/components/ui/fields/field-password.d.cts +13 -0
- package/dist/src/components/ui/fields/field-password.d.ts +4 -4
- package/dist/src/components/ui/fields/field-password.d.ts.map +1 -1
- package/dist/src/components/ui/fields/field-phone.d.cts +11 -0
- package/dist/src/components/ui/fields/field-phone.d.ts +1 -1
- package/dist/src/components/ui/fields/field-phone.d.ts.map +1 -1
- package/dist/src/components/ui/fields/field-text.d.cts +8 -0
- package/dist/src/components/ui/fields/field-text.d.ts +3 -3
- package/dist/src/components/ui/fields/field-text.d.ts.map +1 -1
- package/dist/src/components/ui/fields/index.d.cts +5 -0
- package/dist/src/components/ui/fields/index.d.ts +4 -3
- package/dist/src/components/ui/fields/index.d.ts.map +1 -1
- package/dist/src/components/ui/icon/index.d.cts +11 -0
- package/dist/src/components/ui/icon/index.d.ts +1 -1
- package/dist/src/components/ui/icon/index.d.ts.map +1 -1
- package/dist/src/components/ui/index.d.cts +14 -0
- package/dist/src/components/ui/index.d.ts +13 -12
- package/dist/src/components/ui/index.d.ts.map +1 -1
- package/dist/src/components/ui/link/index.d.cts +11 -0
- package/dist/src/components/ui/link/index.d.ts +1 -1
- package/dist/src/components/ui/link/index.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/code-entry.d.cts +4 -0
- package/dist/src/components/ui/login-screen/code-entry.d.ts +2 -2
- package/dist/src/components/ui/login-screen/consent.d.cts +15 -0
- package/dist/src/components/ui/login-screen/consent.d.ts +2 -2
- package/dist/src/components/ui/login-screen/credentials.d.cts +4 -0
- package/dist/src/components/ui/login-screen/credentials.d.ts +2 -2
- package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/device-approval.d.cts +4 -0
- package/dist/src/components/ui/login-screen/device-approval.d.ts +2 -2
- package/dist/src/components/ui/login-screen/general-error.d.cts +4 -0
- package/dist/src/components/ui/login-screen/general-error.d.ts +2 -2
- package/dist/src/components/ui/login-screen/index.d.cts +4 -0
- package/dist/src/components/ui/login-screen/index.d.ts +3 -3
- package/dist/src/components/ui/login-screen/index.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/invitation.d.cts +4 -0
- package/dist/src/components/ui/login-screen/invitation.d.ts +2 -2
- package/dist/src/components/ui/login-screen/login-screen.d.cts +4 -0
- package/dist/src/components/ui/login-screen/login-screen.d.ts +2 -2
- package/dist/src/components/ui/login-screen/passkey-progress.d.cts +4 -0
- package/dist/src/components/ui/login-screen/passkey-progress.d.ts +2 -2
- package/dist/src/components/ui/login-screen/second-factor.d.cts +4 -0
- package/dist/src/components/ui/login-screen/second-factor.d.ts +2 -2
- package/dist/src/components/ui/login-screen/shared.d.cts +15 -0
- package/dist/src/components/ui/login-screen/shared.d.ts +2 -2
- package/dist/src/components/ui/login-screen/shell.d.cts +13 -0
- package/dist/src/components/ui/login-screen/shell.d.ts +1 -1
- package/dist/src/components/ui/login-screen/shell.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/status.d.cts +4 -0
- package/dist/src/components/ui/login-screen/status.d.ts +2 -2
- package/dist/src/components/ui/login-screen/types.d.cts +192 -0
- package/dist/src/components/ui/login-screen/types.d.ts +2 -2
- package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
- package/dist/src/components/ui/popover/index.d.cts +7 -0
- package/dist/src/components/ui/popover/index.d.ts +5 -5
- package/dist/src/components/ui/popover/index.d.ts.map +1 -1
- package/dist/src/components/ui/providers-box/index.d.cts +10 -0
- package/dist/src/components/ui/providers-box/index.d.ts +2 -2
- package/dist/src/components/ui/providers-box/index.d.ts.map +1 -1
- package/dist/src/components/ui/spinner/index.d.cts +23 -0
- package/dist/src/components/ui/spinner/index.d.ts +1 -1
- package/dist/src/components/ui/spinner/index.d.ts.map +1 -1
- package/dist/src/components/ui/switch/index.d.cts +22 -0
- package/dist/src/components/ui/switch/index.d.ts +1 -1
- package/dist/src/components/ui/switch/index.d.ts.map +1 -1
- package/dist/src/components/ui/upgrade-dialog/challenge.d.cts +12 -0
- package/dist/src/components/ui/upgrade-dialog/challenge.d.ts +2 -2
- package/dist/src/components/ui/upgrade-dialog/factor-list.d.cts +20 -0
- package/dist/src/components/ui/upgrade-dialog/factor-list.d.ts +2 -2
- package/dist/src/components/ui/upgrade-dialog/index.d.cts +8 -0
- package/dist/src/components/ui/upgrade-dialog/index.d.ts +7 -7
- package/dist/src/components/ui/upgrade-dialog/index.d.ts.map +1 -1
- package/dist/src/components/ui/upgrade-dialog/state-mapping.d.cts +130 -0
- package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts +12 -1
- package/dist/src/components/ui/upgrade-dialog/state-mapping.d.ts.map +1 -1
- package/dist/src/components/ui/upgrade-dialog/status.d.cts +27 -0
- package/dist/src/components/ui/upgrade-dialog/status.d.ts +2 -2
- package/dist/src/components/ui/upgrade-dialog/types.d.cts +188 -0
- package/dist/src/components/ui/upgrade-dialog/upgrade-dialog.d.cts +13 -0
- package/dist/src/components/ui/upgrade-dialog/upgrade-dialog.d.ts +2 -2
- package/dist/src/components/ui/visually-hidden/index.d.cts +17 -0
- package/dist/src/components/ui/visually-hidden/index.d.ts +17 -0
- package/dist/src/components/ui/visually-hidden/index.d.ts.map +1 -0
- package/dist/src/constants/countries-phone-code.d.cts +253 -0
- package/dist/src/constants/countries-phone-code.d.ts.map +1 -1
- package/dist/src/constants/formats.d.cts +4 -0
- package/dist/src/constants/formats.d.ts.map +1 -1
- package/dist/src/constants/index.d.cts +3 -0
- package/dist/src/constants/index.d.ts +2 -2
- package/dist/src/context/auth-context.d.cts +23 -0
- package/dist/src/context/auth-context.d.ts +3 -3
- package/dist/src/context/auth-context.d.ts.map +1 -1
- package/dist/src/context/index.d.cts +6 -0
- package/dist/src/context/index.d.ts +5 -5
- package/dist/src/context/index.d.ts.map +1 -1
- package/dist/src/context/navigation-context.d.cts +25 -0
- package/dist/src/context/navigation-context.d.ts +1 -1
- package/dist/src/context/passflow-context.d.cts +26 -0
- package/dist/src/context/passflow-context.d.ts +3 -3
- package/dist/src/context/passflow-context.d.ts.map +1 -1
- package/dist/src/context/router-context.d.cts +42 -0
- package/dist/src/context/router-context.d.ts.map +1 -1
- package/dist/src/context/upgrade-context.d.cts +107 -0
- package/dist/src/context/upgrade-context.d.ts +24 -2
- package/dist/src/hocs/index.d.cts +2 -0
- package/dist/src/hocs/index.d.ts +1 -1
- package/dist/src/hocs/with-error.d.cts +8 -0
- package/dist/src/hocs/with-error.d.ts +5 -5
- package/dist/src/hocs/with-error.d.ts.map +1 -1
- package/dist/src/hooks/index.d.cts +28 -0
- package/dist/src/hooks/index.d.ts +27 -27
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/use-app-settings.d.cts +16 -0
- package/dist/src/hooks/use-app-settings.d.ts +1 -1
- package/dist/src/hooks/use-app-settings.d.ts.map +1 -1
- package/dist/src/hooks/use-auth-cloud-redirect.d.cts +4 -0
- package/dist/src/hooks/use-auth.d.cts +3 -0
- package/dist/src/hooks/use-auth.d.ts +1 -1
- package/dist/src/hooks/use-auth.d.ts.map +1 -1
- package/dist/src/hooks/use-consent.d.cts +68 -0
- package/dist/src/hooks/use-device-verify.d.cts +96 -0
- package/dist/src/hooks/use-device-verify.d.ts +1 -1
- package/dist/src/hooks/use-device-verify.d.ts.map +1 -1
- package/dist/src/hooks/use-forgot-password.d.cts +10 -0
- package/dist/src/hooks/use-forgot-password.d.ts +1 -1
- package/dist/src/hooks/use-join-invite.d.cts +8 -0
- package/dist/src/hooks/use-logout.d.cts +8 -0
- package/dist/src/hooks/use-navigation.d.cts +29 -0
- package/dist/src/hooks/use-navigation.d.ts +2 -2
- package/dist/src/hooks/use-navigation.d.ts.map +1 -1
- package/dist/src/hooks/use-outsideclick.d.cts +3 -0
- package/dist/src/hooks/use-outsideclick.d.ts +2 -2
- package/dist/src/hooks/use-outsideclick.d.ts.map +1 -1
- package/dist/src/hooks/use-passflow-store.d.cts +3 -0
- package/dist/src/hooks/use-passflow-store.d.ts +1 -1
- package/dist/src/hooks/use-passflow.d.cts +3 -0
- package/dist/src/hooks/use-passflow.d.ts +1 -1
- package/dist/src/hooks/use-passflow.d.ts.map +1 -1
- package/dist/src/hooks/use-passwordless-complete.d.cts +10 -0
- package/dist/src/hooks/use-passwordless-complete.d.ts +1 -1
- package/dist/src/hooks/use-passwordless-complete.d.ts.map +1 -1
- package/dist/src/hooks/use-provider.d.cts +7 -0
- package/dist/src/hooks/use-provider.d.ts +1 -1
- package/dist/src/hooks/use-provider.d.ts.map +1 -1
- package/dist/src/hooks/use-reset-password.d.cts +9 -0
- package/dist/src/hooks/use-session-expired.d.cts +49 -0
- package/dist/src/hooks/use-signin.d.cts +11 -0
- package/dist/src/hooks/use-signin.d.ts +2 -2
- package/dist/src/hooks/use-signin.d.ts.map +1 -1
- package/dist/src/hooks/use-signup.d.cts +11 -0
- package/dist/src/hooks/use-signup.d.ts +2 -2
- package/dist/src/hooks/use-signup.d.ts.map +1 -1
- package/dist/src/hooks/use-trusted-devices.d.cts +21 -0
- package/dist/src/hooks/use-trusted-devices.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-challenge.d.cts +16 -0
- package/dist/src/hooks/use-two-factor-challenge.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-manage.d.cts +15 -0
- package/dist/src/hooks/use-two-factor-manage.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-methods.d.cts +14 -0
- package/dist/src/hooks/use-two-factor-methods.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-setup-magic-link.d.cts +55 -0
- package/dist/src/hooks/use-two-factor-setup-magic-link.d.ts.map +1 -1
- package/dist/src/hooks/use-two-factor-setup.d.cts +18 -0
- package/dist/src/hooks/use-two-factor-setup.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-status.d.cts +13 -0
- package/dist/src/hooks/use-two-factor-status.d.ts +1 -1
- package/dist/src/hooks/use-two-factor-verify.d.cts +20 -0
- package/dist/src/hooks/use-two-factor-verify.d.ts +2 -2
- package/dist/src/hooks/use-two-factor-verify.d.ts.map +1 -1
- package/dist/src/hooks/use-upgrade.d.cts +53 -0
- package/dist/src/hooks/use-upgrade.d.ts +12 -2
- package/dist/src/hooks/use-upgrade.d.ts.map +1 -1
- package/dist/src/hooks/use-user-passkeys.d.cts +12 -0
- package/dist/src/hooks/use-user-passkeys.d.ts +1 -1
- package/dist/src/index.d.cts +10 -0
- package/dist/src/index.d.ts +8 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/auth-errors.d.cts +8 -0
- package/dist/src/types/device-errors.d.cts +95 -0
- package/dist/src/types/index.d.cts +26 -0
- package/dist/src/types/index.d.ts +4 -4
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/two-factor-errors.d.cts +14 -0
- package/dist/src/utils/auth-error.d.cts +7 -0
- package/dist/src/utils/auth-error.d.ts +1 -1
- package/dist/src/utils/auth-error.d.ts.map +1 -1
- package/dist/src/utils/classify-device-error.d.cts +35 -0
- package/dist/src/utils/classify-device-error.d.ts +1 -1
- package/dist/src/utils/classify-device-error.d.ts.map +1 -1
- package/dist/src/utils/classify-two-factor-error.d.cts +13 -0
- package/dist/src/utils/classify-two-factor-error.d.ts +1 -1
- package/dist/src/utils/cn.d.cts +3 -0
- package/dist/src/utils/cn.d.ts +1 -1
- package/dist/src/utils/cn.d.ts.map +1 -1
- package/dist/src/utils/dayjs/format.d.cts +8 -0
- package/dist/src/utils/dayjs/format.d.ts.map +1 -1
- package/dist/src/utils/dayjs/index.d.cts +2 -0
- package/dist/src/utils/dayjs/index.d.ts +1 -1
- package/dist/src/utils/get-app-version.d.cts +7 -0
- package/dist/src/utils/get-auth-methods.d.cts +30 -0
- package/dist/src/utils/get-auth-methods.d.ts +1 -1
- package/dist/src/utils/get-auth-methods.d.ts.map +1 -1
- package/dist/src/utils/get-form-labels.d.cts +10 -0
- package/dist/src/utils/get-form-labels.d.ts +5 -5
- package/dist/src/utils/get-form-labels.d.ts.map +1 -1
- package/dist/src/utils/get-url-errors.d.cts +5 -0
- package/dist/src/utils/get-url-errors.d.ts.map +1 -1
- package/dist/src/utils/get-url-with-tokens.d.cts +4 -0
- package/dist/src/utils/get-url-with-tokens.d.ts +1 -1
- package/dist/src/utils/get-url-with-tokens.d.ts.map +1 -1
- package/dist/src/utils/index.d.cts +18 -0
- package/dist/src/utils/index.d.ts +17 -17
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/invitation-auth-chrome.d.cts +8 -0
- package/dist/src/utils/invitation-auth-chrome.d.ts.map +1 -1
- package/dist/src/utils/login-theme.d.cts +8 -0
- package/dist/src/utils/login-theme.d.ts +1 -1
- package/dist/src/utils/login-theme.d.ts.map +1 -1
- package/dist/src/utils/second-factor.d.cts +21 -0
- package/dist/src/utils/second-factor.d.ts +3 -3
- package/dist/src/utils/second-factor.d.ts.map +1 -1
- package/dist/src/utils/two-factor-loop-prevention.d.cts +40 -0
- package/dist/src/utils/two-factor-loop-prevention.d.ts.map +1 -1
- package/dist/src/utils/undefined-on-catch.d.cts +2 -0
- package/dist/src/utils/upgrade-auth.d.cts +82 -0
- package/dist/src/utils/upgrade-auth.d.ts +45 -1
- package/dist/src/utils/upgrade-auth.d.ts.map +1 -1
- package/dist/src/utils/url-params.d.cts +14 -0
- package/dist/src/utils/url-params.d.ts.map +1 -1
- package/dist/src/utils/validate-url.d.cts +2 -0
- package/dist/src/utils/validate-url.d.ts.map +1 -1
- package/dist/src/utils/validation-schemas/index.d.cts +6 -0
- package/dist/src/utils/validation-schemas/index.d.ts +1 -1
- package/dist/src/utils/validation-schemas/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +54 -59
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/src/components/form/two-factor-challenge/otp-input.d.ts +0 -12
- package/dist/src/components/form/two-factor-challenge/otp-input.d.ts.map +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { PassflowPasswordPolicySettings, Providers } from '@passflow/core';
|
|
2
|
+
import type { AuthUiError, DefaultMethod } from '../../../types/index.cjs';
|
|
3
|
+
export type LoginScreenChrome = {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
variant?: 'sign-in';
|
|
7
|
+
customCss?: string;
|
|
8
|
+
customLogo?: string;
|
|
9
|
+
customLogoAlt?: string;
|
|
10
|
+
removeBranding?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type LoginCredentialsValues = {
|
|
13
|
+
method: DefaultMethod | null;
|
|
14
|
+
emailOrUsername: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
password: string;
|
|
17
|
+
};
|
|
18
|
+
export type LoginScreenLink = {
|
|
19
|
+
prompt: string;
|
|
20
|
+
label: string;
|
|
21
|
+
to: string;
|
|
22
|
+
search?: string;
|
|
23
|
+
};
|
|
24
|
+
export type LoginScreenNotice = {
|
|
25
|
+
code?: string;
|
|
26
|
+
appName: string;
|
|
27
|
+
message: string;
|
|
28
|
+
codeTestId?: string;
|
|
29
|
+
appNameTestId?: string;
|
|
30
|
+
};
|
|
31
|
+
export type LoginIdentityMethod = {
|
|
32
|
+
id: DefaultMethod;
|
|
33
|
+
label: string;
|
|
34
|
+
selectLabel: string;
|
|
35
|
+
requiredMessage: string;
|
|
36
|
+
format?: 'email';
|
|
37
|
+
password: boolean;
|
|
38
|
+
passwordlessLabel?: string;
|
|
39
|
+
};
|
|
40
|
+
export type LoginMethodConfig = {
|
|
41
|
+
identities: LoginIdentityMethod[];
|
|
42
|
+
passkey: boolean;
|
|
43
|
+
providers: Providers[];
|
|
44
|
+
};
|
|
45
|
+
export type LoginCredentialsState = {
|
|
46
|
+
kind: 'credentials';
|
|
47
|
+
methods: LoginMethodConfig;
|
|
48
|
+
passwordPolicy: PassflowPasswordPolicySettings | null;
|
|
49
|
+
credentialPurpose?: 'sign-in' | 'sign-up';
|
|
50
|
+
initialMethod?: DefaultMethod | null;
|
|
51
|
+
forcePasskey?: boolean;
|
|
52
|
+
allowPasskeyToggle?: boolean;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
busy?: boolean;
|
|
55
|
+
error?: AuthUiError | null;
|
|
56
|
+
primaryLabel?: string;
|
|
57
|
+
passwordlessLabelPrefix?: string;
|
|
58
|
+
passkeyLabel?: string;
|
|
59
|
+
testId?: string;
|
|
60
|
+
primaryTestId?: string;
|
|
61
|
+
notice?: LoginScreenNotice;
|
|
62
|
+
forgotPassword?: {
|
|
63
|
+
to: string;
|
|
64
|
+
getSearch?: (method: DefaultMethod | null) => string;
|
|
65
|
+
};
|
|
66
|
+
footer?: LoginScreenLink;
|
|
67
|
+
onPassword?: (values: LoginCredentialsValues) => void;
|
|
68
|
+
onPasswordless?: (values: LoginCredentialsValues) => void;
|
|
69
|
+
onPasskey?: () => void;
|
|
70
|
+
onProvider?: (provider: Providers) => void;
|
|
71
|
+
onReset?: () => void;
|
|
72
|
+
};
|
|
73
|
+
export type LoginCodeEntryState = {
|
|
74
|
+
kind: 'code-entry';
|
|
75
|
+
label?: string;
|
|
76
|
+
initialCode?: string;
|
|
77
|
+
error?: string | null;
|
|
78
|
+
busy?: boolean;
|
|
79
|
+
submitLabel?: string;
|
|
80
|
+
testId?: string;
|
|
81
|
+
onSubmit: (code: string) => void;
|
|
82
|
+
};
|
|
83
|
+
export type LoginPasskeyProgressState = {
|
|
84
|
+
kind: 'passkey-progress';
|
|
85
|
+
working: boolean;
|
|
86
|
+
message: string;
|
|
87
|
+
actionLabel?: string;
|
|
88
|
+
error?: string | null;
|
|
89
|
+
recoverable?: boolean;
|
|
90
|
+
retryLabel?: string;
|
|
91
|
+
testId?: string;
|
|
92
|
+
onAction?: () => void;
|
|
93
|
+
onRetry?: () => void;
|
|
94
|
+
};
|
|
95
|
+
export type LoginDeviceApprovalState = {
|
|
96
|
+
kind: 'device-approval';
|
|
97
|
+
appName: string;
|
|
98
|
+
code?: string;
|
|
99
|
+
identity?: string | null;
|
|
100
|
+
busy?: boolean;
|
|
101
|
+
error?: string | null;
|
|
102
|
+
actionLabel?: string;
|
|
103
|
+
busyLabel?: string;
|
|
104
|
+
testId?: string;
|
|
105
|
+
actionTestId?: string;
|
|
106
|
+
codeTestId?: string;
|
|
107
|
+
appNameTestId?: string;
|
|
108
|
+
onApprove: () => void;
|
|
109
|
+
};
|
|
110
|
+
/** A second factor the screen can take, named as the server names it. */
|
|
111
|
+
export type LoginSecondFactorMethod = 'totp' | 'recovery_codes';
|
|
112
|
+
export type LoginSecondFactorState = {
|
|
113
|
+
kind: 'second-factor';
|
|
114
|
+
/** The factors on offer; the first is shown first. */
|
|
115
|
+
methods: LoginSecondFactorMethod[];
|
|
116
|
+
identity?: string | null;
|
|
117
|
+
busy?: boolean;
|
|
118
|
+
error?: string | null;
|
|
119
|
+
submitLabel?: string;
|
|
120
|
+
testId?: string;
|
|
121
|
+
onSubmit: (method: LoginSecondFactorMethod, code: string) => void;
|
|
122
|
+
/** Called when the user switches factor, so a stale error can be cleared. */
|
|
123
|
+
onMethodChange?: () => void;
|
|
124
|
+
};
|
|
125
|
+
export type LoginInvitationState = {
|
|
126
|
+
kind: 'invitation';
|
|
127
|
+
identity?: string | null;
|
|
128
|
+
inviterName?: string | null;
|
|
129
|
+
busy?: boolean;
|
|
130
|
+
error?: string | null;
|
|
131
|
+
acceptLabel?: string;
|
|
132
|
+
busyLabel?: string;
|
|
133
|
+
switchAccountLabel?: string;
|
|
134
|
+
createAccountLabel?: string;
|
|
135
|
+
testId?: string;
|
|
136
|
+
acceptTestId?: string;
|
|
137
|
+
onAccept: () => void;
|
|
138
|
+
onSwitchAccount: () => void;
|
|
139
|
+
onCreateAccount: () => void;
|
|
140
|
+
};
|
|
141
|
+
export type LoginGeneralErrorState = {
|
|
142
|
+
kind: 'general-error';
|
|
143
|
+
message?: string;
|
|
144
|
+
detail?: string;
|
|
145
|
+
actionLabel?: string;
|
|
146
|
+
testId?: string;
|
|
147
|
+
onAction: () => void;
|
|
148
|
+
};
|
|
149
|
+
export type LoginConsentScope = {
|
|
150
|
+
scope: string;
|
|
151
|
+
label: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
granted: boolean;
|
|
154
|
+
};
|
|
155
|
+
export type LoginConsentState = {
|
|
156
|
+
kind: 'consent';
|
|
157
|
+
appName: string;
|
|
158
|
+
scopes: LoginConsentScope[];
|
|
159
|
+
prompt?: string;
|
|
160
|
+
busy?: boolean;
|
|
161
|
+
error?: string | null;
|
|
162
|
+
allowLabel?: string;
|
|
163
|
+
denyLabel?: string;
|
|
164
|
+
busyLabel?: string;
|
|
165
|
+
testId?: string;
|
|
166
|
+
allowTestId?: string;
|
|
167
|
+
denyTestId?: string;
|
|
168
|
+
appNameTestId?: string;
|
|
169
|
+
onToggleScope: (scope: string) => void;
|
|
170
|
+
onAllow: () => void;
|
|
171
|
+
onDeny: () => void;
|
|
172
|
+
};
|
|
173
|
+
export type LoginStatusState = {
|
|
174
|
+
kind: 'status';
|
|
175
|
+
tone: 'success' | 'error' | 'disabled';
|
|
176
|
+
message: string;
|
|
177
|
+
detail?: string;
|
|
178
|
+
recoverable?: boolean;
|
|
179
|
+
retryLabel?: string;
|
|
180
|
+
testId?: string;
|
|
181
|
+
onRetry?: () => void;
|
|
182
|
+
primaryAction?: {
|
|
183
|
+
label: string;
|
|
184
|
+
onClick: () => void;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
|
|
188
|
+
export type LoginScreenProps = {
|
|
189
|
+
chrome: LoginScreenChrome;
|
|
190
|
+
state: LoginScreenState;
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { PassflowPasswordPolicySettings, Providers } from '@passflow/core';
|
|
2
|
+
import type { AuthUiError, DefaultMethod } from '../../../types/index.js';
|
|
3
3
|
export type LoginScreenChrome = {
|
|
4
4
|
title: string;
|
|
5
5
|
subtitle?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
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,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,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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iB,GACjB,gBAAgB,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps>;
|
|
3
|
+
declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const PopoverContent: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
-
declare const Popover: import(
|
|
3
|
-
declare const PopoverTrigger: import(
|
|
4
|
-
declare const PopoverAnchor: import(
|
|
5
|
-
declare const PopoverContent: import(
|
|
6
|
-
export { Popover,
|
|
2
|
+
declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps>;
|
|
3
|
+
declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const PopoverContent: import("react").ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/popover/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAI5D,QAAA,MAAM,OAAO,mDAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,oIAA2B,CAAC;AAEhD,QAAA,MAAM,aAAa,gIAA0B,CAAC;AAE9C,QAAA,MAAM,cAAc,8LAalB,CAAC;AAGH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { Providers } from '@passflow/core';
|
|
3
|
+
type TProvidersBox = {
|
|
4
|
+
providers: Providers[];
|
|
5
|
+
onClick: (provider: Providers) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ProvidersBox: FC<TProvidersBox>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/providers-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/providers-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,aAAa,CAuB1C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
export type SpinnerSize = 'small' | 'medium';
|
|
3
|
+
export type SpinnerProps = {
|
|
4
|
+
/** `small` sits inline beside a line of text; `medium` stands alone. */
|
|
5
|
+
size?: SpinnerSize;
|
|
6
|
+
/**
|
|
7
|
+
* The accessible name. Omit it when a sibling already announces the busy
|
|
8
|
+
* state — the ring is then decorative and hidden from assistive technology,
|
|
9
|
+
* which is what a status region with its own live text wants.
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The indeterminate activity ring.
|
|
15
|
+
*
|
|
16
|
+
* It exists as a primitive so its diameter and stroke live in one place rather
|
|
17
|
+
* than in each consuming component's stylesheet. The upgrade dialog uses it;
|
|
18
|
+
* the login screen still draws its own identical ring in
|
|
19
|
+
* `login-screen.css` and should be migrated onto this when that file is next
|
|
20
|
+
* touched.
|
|
21
|
+
*/
|
|
22
|
+
export declare const Spinner: FC<SpinnerProps>;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/spinner/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/spinner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,eAAe,CAAC;AAEvB,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IACzB,wEAAwE;IACxE,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAOpC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ChangeEvent, type FC } from 'react';
|
|
2
|
+
type TSwitch = {
|
|
3
|
+
label: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Overrides the generated input id. Only needed when something outside this
|
|
8
|
+
* component has to point at the input (`aria-describedby`, a test hook, a
|
|
9
|
+
* label rendered elsewhere).
|
|
10
|
+
*
|
|
11
|
+
* The default is a `useId()` value rather than a constant, because a constant
|
|
12
|
+
* breaks the moment a screen renders more than one Switch: duplicate DOM ids
|
|
13
|
+
* are invalid, and every `<label htmlFor>` would resolve to the FIRST input,
|
|
14
|
+
* so clicking row three would toggle row one. The consent screen renders one
|
|
15
|
+
* Switch per requested scope, so this is load-bearing, not hygiene.
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const Switch: FC<TSwitch>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/switch/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,EAAS,MAAM,OAAO,CAAC;AAGzD,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;OAUG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,OAAO,CAkB9B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { UpgradeDialogChallengeState } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* The collecting view: the suggested factor, its input affordance, the
|
|
5
|
+
* alternatives toggle, and the two terminal controls.
|
|
6
|
+
*
|
|
7
|
+
* Selection is reported through `onSelectFactor` before `onSubmit` ever fires —
|
|
8
|
+
* architecture §13.2's late-join boundary is factor selection, not submission,
|
|
9
|
+
* so the controller must learn of the choice while the user is still typing.
|
|
10
|
+
*/
|
|
11
|
+
export declare const UpgradeChallengeView: FC<UpgradeDialogChallengeState>;
|
|
12
|
+
//# sourceMappingURL=challenge.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { UpgradeDialogChallengeState } from './types';
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { UpgradeDialogChallengeState } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The collecting view: the suggested factor, its input affordance, the
|
|
5
5
|
* alternatives toggle, and the two terminal controls.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { UpgradeDialogFactor, UpgradeFactorType } from './types.cjs';
|
|
3
|
+
type UpgradeFactorListProps = {
|
|
4
|
+
factors: readonly UpgradeDialogFactor[];
|
|
5
|
+
selected: UpgradeFactorType;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
onSelect: (factor: UpgradeFactorType) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The "use another way" alternatives. Selecting one reports the user's choice;
|
|
12
|
+
* it never navigates.
|
|
13
|
+
*
|
|
14
|
+
* Each row is `Button variant='option'`: the two-line geometry and the pressed
|
|
15
|
+
* look belong to that variant in the button library, not to this list. The list
|
|
16
|
+
* contributes layout only.
|
|
17
|
+
*/
|
|
18
|
+
export declare const UpgradeFactorList: FC<UpgradeFactorListProps>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=factor-list.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { UpgradeDialogFactor, UpgradeFactorType } from './types';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { UpgradeDialogFactor, UpgradeFactorType } from './types.js';
|
|
3
3
|
type UpgradeFactorListProps = {
|
|
4
4
|
factors: readonly UpgradeDialogFactor[];
|
|
5
5
|
selected: UpgradeFactorType;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { UpgradeChallengeView } from './challenge.cjs';
|
|
2
|
+
export { UpgradeFactorList } from './factor-list.cjs';
|
|
3
|
+
export type { ToDialogStateInput, UpgradeChallengeSnapshot, UpgradeDialogErrorKind, UpgradeDialogHandlers, UpgradeDialogLabels, UpgradeDialogOutcome, UpgradeDialogUiState, UpgradeFactorSnapshot, UpgradePromptSnapshot, } from './state-mapping.cjs';
|
|
4
|
+
export { DEFAULT_FACTOR_LABELS, describeAssuranceBar, dialogOutcomeFromError, readAssuranceBar, toDialogFactors, toDialogState, UPGRADE_FACTOR_CODE_CONTRACTS, upgradeDialogDismissHandler, } from './state-mapping.cjs';
|
|
5
|
+
export { UPGRADE_SUCCESS_AUTO_CLOSE_MS, UpgradeStatus, type UpgradeStatusState } from './status.cjs';
|
|
6
|
+
export type { AssuranceBar, UpgradeDialogCancelledState, UpgradeDialogChallengeState, UpgradeDialogExhaustedState, UpgradeDialogFactor, UpgradeDialogInsufficientState, UpgradeDialogProps, UpgradeDialogState, UpgradeDialogSuccessState, UpgradeDialogTransportState, UpgradeDialogUnavailableState, UpgradeDialogUnsatisfiableState, UpgradeDialogWorkingState, UpgradeFactorCodeContract, UpgradeFactorInput, UpgradeFactorType, } from './types.cjs';
|
|
7
|
+
export { UpgradeDialog } from './upgrade-dialog.cjs';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
7
|
-
export
|
|
1
|
+
export { UpgradeChallengeView } from './challenge.js';
|
|
2
|
+
export { UpgradeFactorList } from './factor-list.js';
|
|
3
|
+
export type { ToDialogStateInput, UpgradeChallengeSnapshot, UpgradeDialogErrorKind, UpgradeDialogHandlers, UpgradeDialogLabels, UpgradeDialogOutcome, UpgradeDialogUiState, UpgradeFactorSnapshot, UpgradePromptSnapshot, } from './state-mapping.js';
|
|
4
|
+
export { DEFAULT_FACTOR_LABELS, describeAssuranceBar, dialogOutcomeFromError, readAssuranceBar, toDialogFactors, toDialogState, UPGRADE_FACTOR_CODE_CONTRACTS, upgradeDialogDismissHandler, } from './state-mapping.js';
|
|
5
|
+
export { UPGRADE_SUCCESS_AUTO_CLOSE_MS, UpgradeStatus, type UpgradeStatusState } from './status.js';
|
|
6
|
+
export type { AssuranceBar, UpgradeDialogCancelledState, UpgradeDialogChallengeState, UpgradeDialogExhaustedState, UpgradeDialogFactor, UpgradeDialogInsufficientState, UpgradeDialogProps, UpgradeDialogState, UpgradeDialogSuccessState, UpgradeDialogTransportState, UpgradeDialogUnavailableState, UpgradeDialogUnsatisfiableState, UpgradeDialogWorkingState, UpgradeFactorCodeContract, UpgradeFactorInput, UpgradeFactorType, } from './types.js';
|
|
7
|
+
export { UpgradeDialog } from './upgrade-dialog.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/upgrade-dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/upgrade-dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACjG,YAAY,EACV,YAAY,EACZ,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,8BAA8B,EAC9B,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure mapping from the controller's prompt request plus local UI state to the
|
|
3
|
+
* dialog's rendering union. No React, no DOM, no styling — architecture §10.2
|
|
4
|
+
* classifies this as non-visual state mapping, which is why it is the one file
|
|
5
|
+
* in this folder a Vitest spec may cover.
|
|
6
|
+
*
|
|
7
|
+
* The inputs are declared structurally — `UpgradePromptSnapshot` is the shape of
|
|
8
|
+
* `UpgradePromptRequest` that the dialog actually reads — but the one judgement
|
|
9
|
+
* that is NOT structural is which kind of failure an error is: that belongs to
|
|
10
|
+
* `@passflow/core`, which raises the errors, and is imported from it.
|
|
11
|
+
*/
|
|
12
|
+
import type { AssuranceBar, UpgradeDialogFactor, UpgradeDialogState, UpgradeFactorCodeContract, UpgradeFactorInput, UpgradeFactorType } from './types.cjs';
|
|
13
|
+
export type UpgradeChallengeSnapshot = {
|
|
14
|
+
requiredLevel?: number;
|
|
15
|
+
acrValues?: string;
|
|
16
|
+
maxAge?: number;
|
|
17
|
+
};
|
|
18
|
+
export type UpgradeFactorSnapshot = {
|
|
19
|
+
type: UpgradeFactorType;
|
|
20
|
+
input: UpgradeFactorInput;
|
|
21
|
+
};
|
|
22
|
+
export type UpgradePromptSnapshot = {
|
|
23
|
+
challenge: UpgradeChallengeSnapshot;
|
|
24
|
+
/** Already ranked by `selectFactors`; index 0 is the suggested factor. */
|
|
25
|
+
factors: readonly UpgradeFactorSnapshot[];
|
|
26
|
+
previousError?: unknown;
|
|
27
|
+
};
|
|
28
|
+
export type UpgradeDialogLabels = Partial<Record<UpgradeFactorType, {
|
|
29
|
+
label: string;
|
|
30
|
+
hint?: string;
|
|
31
|
+
}>>;
|
|
32
|
+
/** How the flight ended, as the controller's outcome summary reports it (§13.4). */
|
|
33
|
+
export type UpgradeDialogOutcome = {
|
|
34
|
+
kind: 'elevated';
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'insufficient';
|
|
37
|
+
obtained: AssuranceBar;
|
|
38
|
+
required: AssuranceBar;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'cancelled';
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'failed';
|
|
43
|
+
error: unknown;
|
|
44
|
+
};
|
|
45
|
+
export type UpgradeDialogUiState = {
|
|
46
|
+
selected?: UpgradeFactorType | null;
|
|
47
|
+
busy?: boolean;
|
|
48
|
+
showAlternatives?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type UpgradeDialogHandlers = {
|
|
51
|
+
onSelectFactor: (factor: UpgradeFactorType) => void;
|
|
52
|
+
onToggleAlternatives: () => void;
|
|
53
|
+
onSubmit: (code?: string) => void;
|
|
54
|
+
onCancel: () => void;
|
|
55
|
+
onDismiss: () => void;
|
|
56
|
+
onRetry?: () => void;
|
|
57
|
+
};
|
|
58
|
+
export type ToDialogStateInput = {
|
|
59
|
+
prompt: UpgradePromptSnapshot | null;
|
|
60
|
+
outcome?: UpgradeDialogOutcome;
|
|
61
|
+
ui?: UpgradeDialogUiState;
|
|
62
|
+
labels?: UpgradeDialogLabels;
|
|
63
|
+
handlers: UpgradeDialogHandlers;
|
|
64
|
+
testId?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* How an elevation failure reads to the user. `rejected` is the retryable
|
|
68
|
+
* wrong-answer case, which keeps the dialog open on the challenge.
|
|
69
|
+
*/
|
|
70
|
+
export type UpgradeDialogErrorKind = 'rejected' | 'cancelled' | 'exhausted' | 'unsatisfiable' | 'unavailable' | 'transport' | 'insufficient' | 'session-changed';
|
|
71
|
+
export declare const DEFAULT_FACTOR_LABELS: Record<UpgradeFactorType, {
|
|
72
|
+
label: string;
|
|
73
|
+
hint?: string;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Per-factor code contracts, keyed by the factor type, which is the only thing
|
|
77
|
+
* about a factor the protocol guarantees.
|
|
78
|
+
*
|
|
79
|
+
* `recovery_codes` is the reason this table exists. The server generates them
|
|
80
|
+
* at `DefaultRecoveryCodeLength` (12) from a 32-character alphanumeric charset
|
|
81
|
+
* and accepts a configured length anywhere in 6..16, so the cap is the server's
|
|
82
|
+
* MAXIMUM — capping at the default would reject a valid code on a deployment
|
|
83
|
+
* that raised it, and capping at six (the old single hardcoded number) rejected
|
|
84
|
+
* every code on every deployment. A shorter configured code simply types
|
|
85
|
+
* shorter; a cap can only ever do harm by being too small.
|
|
86
|
+
*
|
|
87
|
+
* `null` means the factor collects nothing typed: its proof comes from the
|
|
88
|
+
* ceremony, so there is no field and no contract to state.
|
|
89
|
+
*/
|
|
90
|
+
export declare const UPGRADE_FACTOR_CODE_CONTRACTS: Readonly<{
|
|
91
|
+
totp: UpgradeFactorCodeContract;
|
|
92
|
+
email_otp: UpgradeFactorCodeContract;
|
|
93
|
+
sms_otp: UpgradeFactorCodeContract;
|
|
94
|
+
recovery_codes: UpgradeFactorCodeContract;
|
|
95
|
+
passkey: null;
|
|
96
|
+
}>;
|
|
97
|
+
/** Index 0 stays index 0: `selectFactors` already ranked the list, and ranking is not filtering. */
|
|
98
|
+
export declare const toDialogFactors: (factors: readonly UpgradeFactorSnapshot[], labels?: UpgradeDialogLabels) => UpgradeDialogFactor[];
|
|
99
|
+
/**
|
|
100
|
+
* How a failure reads to the user, as the dialog's own vocabulary.
|
|
101
|
+
*
|
|
102
|
+
* Named `dialogOutcomeFromError`, not `classifyUpgradeError`: that name belongs
|
|
103
|
+
* to `@passflow/core`, and holding it here shadowed core's symbol in the
|
|
104
|
+
* package's own star exports, which made the real classifier unreachable to
|
|
105
|
+
* consumers. This function decides nothing about what the error IS — core's
|
|
106
|
+
* classifier does — only which panel that kind is shown on.
|
|
107
|
+
*
|
|
108
|
+
* The dedicated error classes are matched before the kind table because they
|
|
109
|
+
* are not transport failures at all: they carry no `kind`, and core's
|
|
110
|
+
* classifier has nothing to say about them.
|
|
111
|
+
*/
|
|
112
|
+
export declare const dialogOutcomeFromError: (error: unknown) => UpgradeDialogErrorKind;
|
|
113
|
+
export declare const readAssuranceBar: (value: unknown) => AssuranceBar | undefined;
|
|
114
|
+
/** Human wording for a bar, on whichever axis it constrains. */
|
|
115
|
+
export declare const describeAssuranceBar: (bar?: AssuranceBar) => string;
|
|
116
|
+
/**
|
|
117
|
+
* The single projection. A terminal `outcome` always wins over an open prompt;
|
|
118
|
+
* an empty offered factor list is the `no usable factor` outcome; a `busy`
|
|
119
|
+
* ceremony with no code to type is `working`; everything else is the challenge.
|
|
120
|
+
*/
|
|
121
|
+
export declare const toDialogState: (input: ToDialogStateInput) => UpgradeDialogState;
|
|
122
|
+
/**
|
|
123
|
+
* What Escape and an overlay click mean in each state. Cancellation must reach
|
|
124
|
+
* the controller or the caller's promise hangs (§8.1), so this is never a bare
|
|
125
|
+
* close; `success` has nothing to cancel, so it closes instead of cancelling —
|
|
126
|
+
* returning `undefined` there made Escape and the overlay inert on the one
|
|
127
|
+
* state every user reaches.
|
|
128
|
+
*/
|
|
129
|
+
export declare const upgradeDialogDismissHandler: (state: UpgradeDialogState) => (() => void) | undefined;
|
|
130
|
+
//# sourceMappingURL=state-mapping.d.ts.map
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Pure mapping from the controller's prompt request plus local UI state to the
|
|
3
|
+
* dialog's rendering union. No React, no DOM, no styling — architecture §10.2
|
|
4
|
+
* classifies this as non-visual state mapping, which is why it is the one file
|
|
5
|
+
* in this folder a Vitest spec may cover.
|
|
6
|
+
*
|
|
7
|
+
* The inputs are declared structurally — `UpgradePromptSnapshot` is the shape of
|
|
8
|
+
* `UpgradePromptRequest` that the dialog actually reads — but the one judgement
|
|
9
|
+
* that is NOT structural is which kind of failure an error is: that belongs to
|
|
10
|
+
* `@passflow/core`, which raises the errors, and is imported from it.
|
|
11
|
+
*/
|
|
12
|
+
import type { AssuranceBar, UpgradeDialogFactor, UpgradeDialogState, UpgradeFactorCodeContract, UpgradeFactorInput, UpgradeFactorType } from './types.js';
|
|
2
13
|
export type UpgradeChallengeSnapshot = {
|
|
3
14
|
requiredLevel?: number;
|
|
4
15
|
acrValues?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-mapping.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/upgrade-dialog/state-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,wBAAwB,CAAC;IACpC,0EAA0E;IAC1E,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC1C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAEvG,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,Q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