@clerk/ui 1.41.2-snapshot.v20261021181323 → 1.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClerkUI.js +2 -2
- package/dist/common/constants.js +8 -3
- package/dist/common/constants.js.map +1 -1
- package/dist/components/ImpersonationFab/index.js +46 -16
- package/dist/components/ImpersonationFab/index.js.map +1 -1
- package/dist/components/SignIn/SignInStart.js +1 -1
- package/dist/components/SignIn/SignInStart.js.map +1 -1
- package/dist/components/SignUp/SignUpForm.js +8 -3
- package/dist/components/SignUp/SignUpForm.js.map +1 -1
- package/dist/components/devPrompts/KeylessPrompt/use-drag-to-corner.js +47 -142
- package/dist/components/devPrompts/KeylessPrompt/use-drag-to-corner.js.map +1 -1
- package/dist/hooks/useDragGesture.js +64 -0
- package/dist/hooks/useDragGesture.js.map +1 -0
- package/dist/hooks/usePrefersReducedMotion.js +10 -18
- package/dist/hooks/usePrefersReducedMotion.js.map +1 -1
- package/dist/impersonationfab_ui_3ff598_1.41.2.js +1 -0
- package/dist/impersonationfab_ui_91f873_1.41.2.js +1 -0
- package/dist/impersonationfab_ui_e564da_1.41.2.js +1 -0
- package/dist/index.js +1 -1
- package/dist/keylessPrompt_ui_3ff598_1.41.2.js +1 -0
- package/dist/{keylessPrompt_ui_84097d_1.41.2-snapshot.v20261021181323.js → keylessPrompt_ui_91f873_1.41.2.js} +21 -21
- package/dist/{keylessPrompt_ui_d760ca_1.41.2-snapshot.v20261021181323.js → keylessPrompt_ui_e564da_1.41.2.js} +21 -21
- package/dist/no-rhc/ClerkUI.js +2 -2
- package/dist/no-rhc/common/constants.js +8 -3
- package/dist/no-rhc/common/constants.js.map +1 -1
- package/dist/no-rhc/components/ImpersonationFab/index.js +46 -16
- package/dist/no-rhc/components/ImpersonationFab/index.js.map +1 -1
- package/dist/no-rhc/components/SignIn/SignInStart.js +1 -1
- package/dist/no-rhc/components/SignIn/SignInStart.js.map +1 -1
- package/dist/no-rhc/components/SignUp/SignUpForm.js +8 -3
- package/dist/no-rhc/components/SignUp/SignUpForm.js.map +1 -1
- package/dist/no-rhc/components/devPrompts/KeylessPrompt/use-drag-to-corner.js +47 -142
- package/dist/no-rhc/components/devPrompts/KeylessPrompt/use-drag-to-corner.js.map +1 -1
- package/dist/no-rhc/hooks/useDragGesture.js +64 -0
- package/dist/no-rhc/hooks/useDragGesture.js.map +1 -0
- package/dist/no-rhc/hooks/usePrefersReducedMotion.js +10 -18
- package/dist/no-rhc/hooks/usePrefersReducedMotion.js.map +1 -1
- package/dist/no-rhc/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/{signin_ui_9796e5_1.41.2-snapshot.v20261021181323.js → signin_ui_3ff598_1.41.2.js} +1 -1
- package/dist/{signin_ui_84097d_1.41.2-snapshot.v20261021181323.js → signin_ui_91f873_1.41.2.js} +1 -1
- package/dist/{signin_ui_d760ca_1.41.2-snapshot.v20261021181323.js → signin_ui_e564da_1.41.2.js} +1 -1
- package/dist/signup_ui_3ff598_1.41.2.js +1 -0
- package/dist/signup_ui_91f873_1.41.2.js +1 -0
- package/dist/signup_ui_e564da_1.41.2.js +1 -0
- package/dist/ui-common_ui_3ff598_1.41.2.js +1 -0
- package/dist/{ui-common_ui_84097d_1.41.2-snapshot.v20261021181323.js → ui-common_ui_91f873_1.41.2.js} +5 -5
- package/dist/{ui-common_ui_d760ca_1.41.2-snapshot.v20261021181323.js → ui-common_ui_e564da_1.41.2.js} +5 -5
- package/dist/ui.browser.js +6 -6
- package/dist/ui.legacy.browser.js +1 -1
- package/dist/ui.shared.browser.js +4 -4
- package/package.json +3 -3
- package/dist/components/ImpersonationFab/index.d.ts +0 -1
- package/dist/impersonationfab_ui_84097d_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/impersonationfab_ui_9796e5_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/impersonationfab_ui_d760ca_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/keylessPrompt_ui_9796e5_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/signup_ui_84097d_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/signup_ui_9796e5_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/signup_ui_d760ca_1.41.2-snapshot.v20261021181323.js +0 -1
- package/dist/ui-common_ui_9796e5_1.41.2-snapshot.v20261021181323.js +0 -1
- /package/dist/{3736_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 3736_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{3736_ui_84097d_1.41.2-snapshot.v20261021181323.js → 3736_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{3736_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 3736_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{4424_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 4424_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{4424_ui_84097d_1.41.2-snapshot.v20261021181323.js → 4424_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{4424_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 4424_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{524_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 524_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{524_ui_84097d_1.41.2-snapshot.v20261021181323.js → 524_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{524_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 524_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{6206_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 6206_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{6206_ui_84097d_1.41.2-snapshot.v20261021181323.js → 6206_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{6206_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 6206_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{6678_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 6678_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{6678_ui_84097d_1.41.2-snapshot.v20261021181323.js → 6678_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{6678_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 6678_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{7181_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 7181_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{7181_ui_84097d_1.41.2-snapshot.v20261021181323.js → 7181_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{7181_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 7181_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{8316_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 8316_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{8316_ui_84097d_1.41.2-snapshot.v20261021181323.js → 8316_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{8316_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 8316_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{8746_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 8746_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{8746_ui_84097d_1.41.2-snapshot.v20261021181323.js → 8746_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{8746_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 8746_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{9419_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 9419_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{9419_ui_84097d_1.41.2-snapshot.v20261021181323.js → 9419_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{9419_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 9419_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{980_ui_9796e5_1.41.2-snapshot.v20261021181323.js → 980_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{980_ui_84097d_1.41.2-snapshot.v20261021181323.js → 980_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{980_ui_d760ca_1.41.2-snapshot.v20261021181323.js → 980_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{apiKeys_ui_9796e5_1.41.2-snapshot.v20261021181323.js → apiKeys_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{apiKeys_ui_84097d_1.41.2-snapshot.v20261021181323.js → apiKeys_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{apiKeys_ui_d760ca_1.41.2-snapshot.v20261021181323.js → apiKeys_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{blankcaptcha_ui_9796e5_1.41.2-snapshot.v20261021181323.js → blankcaptcha_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{blankcaptcha_ui_84097d_1.41.2-snapshot.v20261021181323.js → blankcaptcha_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{blankcaptcha_ui_d760ca_1.41.2-snapshot.v20261021181323.js → blankcaptcha_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{checkout_ui_9796e5_1.41.2-snapshot.v20261021181323.js → checkout_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{checkout_ui_84097d_1.41.2-snapshot.v20261021181323.js → checkout_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{checkout_ui_d760ca_1.41.2-snapshot.v20261021181323.js → checkout_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{configureDirectorySync_ui_9796e5_1.41.2-snapshot.v20261021181323.js → configureDirectorySync_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{configureDirectorySync_ui_84097d_1.41.2-snapshot.v20261021181323.js → configureDirectorySync_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{configureDirectorySync_ui_d760ca_1.41.2-snapshot.v20261021181323.js → configureDirectorySync_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{configureSSO_ui_9796e5_1.41.2-snapshot.v20261021181323.js → configureSSO_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{configureSSO_ui_84097d_1.41.2-snapshot.v20261021181323.js → configureSSO_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{configureSSO_ui_d760ca_1.41.2-snapshot.v20261021181323.js → configureSSO_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_9796e5_1.41.2-snapshot.v20261021181323.js → copy-api-key-modal_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_84097d_1.41.2-snapshot.v20261021181323.js → copy-api-key-modal_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_d760ca_1.41.2-snapshot.v20261021181323.js → copy-api-key-modal_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{createorganization_ui_9796e5_1.41.2-snapshot.v20261021181323.js → createorganization_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{createorganization_ui_84097d_1.41.2-snapshot.v20261021181323.js → createorganization_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{createorganization_ui_d760ca_1.41.2-snapshot.v20261021181323.js → createorganization_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{credit-history-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → credit-history-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{credit-history-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → credit-history-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{credit-history-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → credit-history-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_9796e5_1.41.2-snapshot.v20261021181323.js → enableOrganizationsPrompt_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_84097d_1.41.2-snapshot.v20261021181323.js → enableOrganizationsPrompt_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_d760ca_1.41.2-snapshot.v20261021181323.js → enableOrganizationsPrompt_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{framework_ui_9796e5_1.41.2-snapshot.v20261021181323.js → framework_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{framework_ui_d760ca_1.41.2-snapshot.v20261021181323.js → framework_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{invitemembers_ui_9796e5_1.41.2-snapshot.v20261021181323.js → invitemembers_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{invitemembers_ui_84097d_1.41.2-snapshot.v20261021181323.js → invitemembers_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{invitemembers_ui_d760ca_1.41.2-snapshot.v20261021181323.js → invitemembers_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{oauthConsent_ui_9796e5_1.41.2-snapshot.v20261021181323.js → oauthConsent_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{oauthConsent_ui_84097d_1.41.2-snapshot.v20261021181323.js → oauthConsent_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{oauthConsent_ui_d760ca_1.41.2-snapshot.v20261021181323.js → oauthConsent_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{oauthDeviceVerification_ui_9796e5_1.41.2-snapshot.v20261021181323.js → oauthDeviceVerification_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{oauthDeviceVerification_ui_84097d_1.41.2-snapshot.v20261021181323.js → oauthDeviceVerification_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{oauthDeviceVerification_ui_d760ca_1.41.2-snapshot.v20261021181323.js → oauthDeviceVerification_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{onetap_ui_9796e5_1.41.2-snapshot.v20261021181323.js → onetap_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{onetap_ui_84097d_1.41.2-snapshot.v20261021181323.js → onetap_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{onetap_ui_d760ca_1.41.2-snapshot.v20261021181323.js → onetap_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{op-api-keys-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → op-api-keys-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{op-api-keys-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → op-api-keys-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{op-api-keys-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → op-api-keys-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{op-billing-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → op-billing-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{op-billing-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → op-billing-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{op-billing-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → op-billing-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{op-plans-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → op-plans-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{op-plans-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → op-plans-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{op-plans-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → op-plans-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{op-security-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → op-security-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{op-security-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → op-security-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{op-security-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → op-security-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{organizationlist_ui_9796e5_1.41.2-snapshot.v20261021181323.js → organizationlist_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{organizationlist_ui_84097d_1.41.2-snapshot.v20261021181323.js → organizationlist_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{organizationlist_ui_d760ca_1.41.2-snapshot.v20261021181323.js → organizationlist_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{organizationprofile_ui_9796e5_1.41.2-snapshot.v20261021181323.js → organizationprofile_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{organizationprofile_ui_84097d_1.41.2-snapshot.v20261021181323.js → organizationprofile_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{organizationprofile_ui_d760ca_1.41.2-snapshot.v20261021181323.js → organizationprofile_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{organizationswitcher_ui_9796e5_1.41.2-snapshot.v20261021181323.js → organizationswitcher_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{organizationswitcher_ui_84097d_1.41.2-snapshot.v20261021181323.js → organizationswitcher_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{organizationswitcher_ui_d760ca_1.41.2-snapshot.v20261021181323.js → organizationswitcher_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{payment-attempt-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → payment-attempt-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{payment-attempt-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → payment-attempt-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{payment-attempt-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → payment-attempt-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{planDetails_ui_9796e5_1.41.2-snapshot.v20261021181323.js → planDetails_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{planDetails_ui_84097d_1.41.2-snapshot.v20261021181323.js → planDetails_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{planDetails_ui_d760ca_1.41.2-snapshot.v20261021181323.js → planDetails_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_9796e5_1.41.2-snapshot.v20261021181323.js → prefetchorganizationlist_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_84097d_1.41.2-snapshot.v20261021181323.js → prefetchorganizationlist_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_d760ca_1.41.2-snapshot.v20261021181323.js → prefetchorganizationlist_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{pricingTable_ui_9796e5_1.41.2-snapshot.v20261021181323.js → pricingTable_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{pricingTable_ui_84097d_1.41.2-snapshot.v20261021181323.js → pricingTable_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{pricingTable_ui_d760ca_1.41.2-snapshot.v20261021181323.js → pricingTable_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{protectcheck_ui_9796e5_1.41.2-snapshot.v20261021181323.js → protectcheck_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{protectcheck_ui_84097d_1.41.2-snapshot.v20261021181323.js → protectcheck_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{protectcheck_ui_d760ca_1.41.2-snapshot.v20261021181323.js → protectcheck_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_9796e5_1.41.2-snapshot.v20261021181323.js → revoke-api-key-modal_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_84097d_1.41.2-snapshot.v20261021181323.js → revoke-api-key-modal_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_d760ca_1.41.2-snapshot.v20261021181323.js → revoke-api-key-modal_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{sessionTasks_ui_9796e5_1.41.2-snapshot.v20261021181323.js → sessionTasks_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{sessionTasks_ui_84097d_1.41.2-snapshot.v20261021181323.js → sessionTasks_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{sessionTasks_ui_d760ca_1.41.2-snapshot.v20261021181323.js → sessionTasks_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{statement-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → statement-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{statement-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → statement-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{statement-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → statement-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{subscriptionDetails_ui_9796e5_1.41.2-snapshot.v20261021181323.js → subscriptionDetails_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{subscriptionDetails_ui_84097d_1.41.2-snapshot.v20261021181323.js → subscriptionDetails_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{subscriptionDetails_ui_d760ca_1.41.2-snapshot.v20261021181323.js → subscriptionDetails_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_9796e5_1.41.2-snapshot.v20261021181323.js → taskChooseOrganization_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_84097d_1.41.2-snapshot.v20261021181323.js → taskChooseOrganization_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_d760ca_1.41.2-snapshot.v20261021181323.js → taskChooseOrganization_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{taskResetPassword_ui_9796e5_1.41.2-snapshot.v20261021181323.js → taskResetPassword_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{taskResetPassword_ui_84097d_1.41.2-snapshot.v20261021181323.js → taskResetPassword_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{taskResetPassword_ui_d760ca_1.41.2-snapshot.v20261021181323.js → taskResetPassword_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{taskSetupMFA_ui_9796e5_1.41.2-snapshot.v20261021181323.js → taskSetupMFA_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{taskSetupMFA_ui_84097d_1.41.2-snapshot.v20261021181323.js → taskSetupMFA_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{taskSetupMFA_ui_d760ca_1.41.2-snapshot.v20261021181323.js → taskSetupMFA_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{up-api-keys-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → up-api-keys-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{up-api-keys-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → up-api-keys-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{up-api-keys-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → up-api-keys-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{up-billing-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → up-billing-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{up-billing-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → up-billing-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{up-billing-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → up-billing-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{up-plans-page_ui_9796e5_1.41.2-snapshot.v20261021181323.js → up-plans-page_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{up-plans-page_ui_84097d_1.41.2-snapshot.v20261021181323.js → up-plans-page_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{up-plans-page_ui_d760ca_1.41.2-snapshot.v20261021181323.js → up-plans-page_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{useravatar_ui_9796e5_1.41.2-snapshot.v20261021181323.js → useravatar_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{useravatar_ui_84097d_1.41.2-snapshot.v20261021181323.js → useravatar_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{useravatar_ui_d760ca_1.41.2-snapshot.v20261021181323.js → useravatar_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{userbutton_ui_9796e5_1.41.2-snapshot.v20261021181323.js → userbutton_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{userbutton_ui_84097d_1.41.2-snapshot.v20261021181323.js → userbutton_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{userbutton_ui_d760ca_1.41.2-snapshot.v20261021181323.js → userbutton_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{userprofile_ui_9796e5_1.41.2-snapshot.v20261021181323.js → userprofile_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{userprofile_ui_84097d_1.41.2-snapshot.v20261021181323.js → userprofile_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{userprofile_ui_d760ca_1.41.2-snapshot.v20261021181323.js → userprofile_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{userverification_ui_9796e5_1.41.2-snapshot.v20261021181323.js → userverification_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{userverification_ui_84097d_1.41.2-snapshot.v20261021181323.js → userverification_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{userverification_ui_d760ca_1.41.2-snapshot.v20261021181323.js → userverification_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{vendors_ui_9796e5_1.41.2-snapshot.v20261021181323.js → vendors_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{vendors_ui_84097d_1.41.2-snapshot.v20261021181323.js → vendors_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{vendors_ui_d760ca_1.41.2-snapshot.v20261021181323.js → vendors_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{waitlist_ui_9796e5_1.41.2-snapshot.v20261021181323.js → waitlist_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{waitlist_ui_84097d_1.41.2-snapshot.v20261021181323.js → waitlist_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{waitlist_ui_d760ca_1.41.2-snapshot.v20261021181323.js → waitlist_ui_e564da_1.41.2.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_9796e5_1.41.2-snapshot.v20261021181323.js → web3-solana-wallet-buttons_ui_3ff598_1.41.2.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_84097d_1.41.2-snapshot.v20261021181323.js → web3-solana-wallet-buttons_ui_91f873_1.41.2.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_d760ca_1.41.2-snapshot.v20261021181323.js → web3-solana-wallet-buttons_ui_e564da_1.41.2.js} +0 -0
package/dist/ClerkUI.js
CHANGED
|
@@ -22,8 +22,8 @@ import { isVersionAtLeast, parseVersion } from "@clerk/shared/versionCheck";
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
var ClerkUI = class ClerkUI {
|
|
25
|
-
static version = "1.41.2
|
|
26
|
-
version = "1.41.2
|
|
25
|
+
static version = "1.41.2";
|
|
26
|
+
version = "1.41.2";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
package/dist/common/constants.js
CHANGED
|
@@ -6,6 +6,7 @@ const FirstFactorConfigs = Object.freeze({
|
|
|
6
6
|
label: localizationKeys("formFieldLabel__emailAddress_username"),
|
|
7
7
|
placeholder: localizationKeys("formFieldInputPlaceholder__emailAddress_username"),
|
|
8
8
|
type: "text",
|
|
9
|
+
autoComplete: "username",
|
|
9
10
|
action: localizationKeys("signIn.start.actionLink__use_email_username"),
|
|
10
11
|
validLastAuthenticationStrategies: new Set([
|
|
11
12
|
"email_code",
|
|
@@ -19,6 +20,7 @@ const FirstFactorConfigs = Object.freeze({
|
|
|
19
20
|
label: localizationKeys("formFieldLabel__emailAddress"),
|
|
20
21
|
placeholder: localizationKeys("formFieldInputPlaceholder__emailAddress"),
|
|
21
22
|
type: "email",
|
|
23
|
+
autoComplete: "email",
|
|
22
24
|
action: localizationKeys("signIn.start.actionLink__use_email"),
|
|
23
25
|
validLastAuthenticationStrategies: new Set([
|
|
24
26
|
"email_code",
|
|
@@ -31,6 +33,7 @@ const FirstFactorConfigs = Object.freeze({
|
|
|
31
33
|
label: localizationKeys("formFieldLabel__phoneNumber"),
|
|
32
34
|
placeholder: localizationKeys("formFieldInputPlaceholder__phoneNumber"),
|
|
33
35
|
type: "tel",
|
|
36
|
+
autoComplete: "tel",
|
|
34
37
|
action: localizationKeys("signIn.start.actionLink__use_phone"),
|
|
35
38
|
validLastAuthenticationStrategies: new Set(["phone_code", "password"])
|
|
36
39
|
},
|
|
@@ -38,6 +41,7 @@ const FirstFactorConfigs = Object.freeze({
|
|
|
38
41
|
label: localizationKeys("formFieldLabel__username"),
|
|
39
42
|
placeholder: localizationKeys("formFieldInputPlaceholder__username"),
|
|
40
43
|
type: "text",
|
|
44
|
+
autoComplete: "username",
|
|
41
45
|
action: localizationKeys("signIn.start.actionLink__use_username"),
|
|
42
46
|
validLastAuthenticationStrategies: new Set(["username", "password"])
|
|
43
47
|
},
|
|
@@ -45,14 +49,15 @@ const FirstFactorConfigs = Object.freeze({
|
|
|
45
49
|
label: "",
|
|
46
50
|
placeholder: "",
|
|
47
51
|
type: "text",
|
|
52
|
+
autoComplete: "username",
|
|
48
53
|
action: "",
|
|
49
54
|
validLastAuthenticationStrategies: /* @__PURE__ */ new Set()
|
|
50
55
|
}
|
|
51
56
|
});
|
|
52
57
|
const groupIdentifiers = (attributes) => {
|
|
53
|
-
let newAttributes =
|
|
54
|
-
if (
|
|
55
|
-
newAttributes = newAttributes.filter((a) =>
|
|
58
|
+
let newAttributes = attributes.filter((a) => a !== "passkey");
|
|
59
|
+
if (newAttributes.includes("email_address") && newAttributes.includes("username")) {
|
|
60
|
+
newAttributes = newAttributes.filter((a) => a !== "email_address" && a !== "username");
|
|
56
61
|
newAttributes.unshift("email_address_username");
|
|
57
62
|
}
|
|
58
63
|
return newAttributes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../src/common/constants.ts"],"sourcesContent":["import type { Attribute, LastAuthenticationStrategy } from '@clerk/shared/types';\n\nimport type { LocalizationKey } from '../localization/localizationKeys';\nimport { localizationKeys } from '../localization/localizationKeys';\n\ntype FirstFactorConfig = {\n label: string | LocalizationKey;\n type: string;\n placeholder: string | LocalizationKey;\n action?: string | LocalizationKey;\n validLastAuthenticationStrategies: ReadonlySet<LastAuthenticationStrategy>;\n};\nconst FirstFactorConfigs = Object.freeze({\n email_address_username: {\n label: localizationKeys('formFieldLabel__emailAddress_username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress_username'),\n type: 'text',\n action: localizationKeys('signIn.start.actionLink__use_email_username'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>([\n 'email_code',\n 'email_link',\n 'email_address',\n 'username',\n 'password',\n ]),\n },\n email_address: {\n label: localizationKeys('formFieldLabel__emailAddress'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress'),\n type: 'email',\n action: localizationKeys('signIn.start.actionLink__use_email'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>([\n 'email_code',\n 'email_link',\n 'email_address',\n 'password',\n ]),\n },\n phone_number: {\n label: localizationKeys('formFieldLabel__phoneNumber'),\n placeholder: localizationKeys('formFieldInputPlaceholder__phoneNumber'),\n type: 'tel',\n action: localizationKeys('signIn.start.actionLink__use_phone'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(['phone_code', 'password']),\n },\n username: {\n label: localizationKeys('formFieldLabel__username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__username'),\n type: 'text',\n action: localizationKeys('signIn.start.actionLink__use_username'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(['username', 'password']),\n },\n default: {\n label: '',\n placeholder: '',\n type: 'text',\n action: '',\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(),\n },\n}
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../src/common/constants.ts"],"sourcesContent":["import type { Attribute, LastAuthenticationStrategy } from '@clerk/shared/types';\n\nimport type { LocalizationKey } from '../localization/localizationKeys';\nimport { localizationKeys } from '../localization/localizationKeys';\n\ntype FirstFactorConfig = {\n label: string | LocalizationKey;\n type: string;\n autoComplete: 'email' | 'tel' | 'username';\n placeholder: string | LocalizationKey;\n action?: string | LocalizationKey;\n validLastAuthenticationStrategies: ReadonlySet<LastAuthenticationStrategy>;\n};\nconst FirstFactorConfigs = Object.freeze({\n email_address_username: {\n label: localizationKeys('formFieldLabel__emailAddress_username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress_username'),\n type: 'text',\n autoComplete: 'username',\n action: localizationKeys('signIn.start.actionLink__use_email_username'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>([\n 'email_code',\n 'email_link',\n 'email_address',\n 'username',\n 'password',\n ]),\n },\n email_address: {\n label: localizationKeys('formFieldLabel__emailAddress'),\n placeholder: localizationKeys('formFieldInputPlaceholder__emailAddress'),\n type: 'email',\n autoComplete: 'email',\n action: localizationKeys('signIn.start.actionLink__use_email'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>([\n 'email_code',\n 'email_link',\n 'email_address',\n 'password',\n ]),\n },\n phone_number: {\n label: localizationKeys('formFieldLabel__phoneNumber'),\n placeholder: localizationKeys('formFieldInputPlaceholder__phoneNumber'),\n type: 'tel',\n autoComplete: 'tel',\n action: localizationKeys('signIn.start.actionLink__use_phone'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(['phone_code', 'password']),\n },\n username: {\n label: localizationKeys('formFieldLabel__username'),\n placeholder: localizationKeys('formFieldInputPlaceholder__username'),\n type: 'text',\n autoComplete: 'username',\n action: localizationKeys('signIn.start.actionLink__use_username'),\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(['username', 'password']),\n },\n default: {\n label: '',\n placeholder: '',\n type: 'text',\n autoComplete: 'username',\n action: '',\n validLastAuthenticationStrategies: new Set<LastAuthenticationStrategy>(),\n },\n} satisfies Record<SignInStartIdentifier | 'default', FirstFactorConfig>);\n\nexport type SignInStartIdentifier = 'email_address' | 'username' | 'phone_number' | 'email_address_username';\nexport const groupIdentifiers = (attributes: Attribute[]): SignInStartIdentifier[] => {\n // Always skip passkey, while passkey can be considered an identifier we want to exclude it in the UI we are delivering\n let newAttributes: string[] = attributes.filter(a => a !== 'passkey');\n\n //merge email_address and username attributes\n if (newAttributes.includes('email_address') && newAttributes.includes('username')) {\n newAttributes = newAttributes.filter(a => a !== 'email_address' && a !== 'username');\n newAttributes.unshift('email_address_username');\n }\n\n return newAttributes as SignInStartIdentifier[];\n};\n\nexport const getIdentifierControlDisplayValues = (\n identifiers: SignInStartIdentifier[],\n identifier: SignInStartIdentifier,\n): { currentIdentifier: FirstFactorConfig; nextIdentifier?: FirstFactorConfig } => {\n const index = identifiers.indexOf(identifier);\n\n if (index === -1) {\n return { currentIdentifier: { ...FirstFactorConfigs['default'] }, nextIdentifier: undefined };\n }\n\n return {\n currentIdentifier: { ...FirstFactorConfigs[identifier] },\n nextIdentifier:\n identifiers.length > 1 ? { ...FirstFactorConfigs[identifiers[(index + 1) % identifiers.length]] } : undefined,\n };\n};\n\nexport const PREFERRED_SIGN_IN_STRATEGIES = Object.freeze({\n Password: 'password',\n OTP: 'otp',\n});\n"],"mappings":";;;AAaA,MAAM,qBAAqB,OAAO,OAAO;CACvC,wBAAwB;EACtB,OAAO,iBAAiB,uCAAuC;EAC/D,aAAa,iBAAiB,kDAAkD;EAChF,MAAM;EACN,cAAc;EACd,QAAQ,iBAAiB,6CAA6C;EACtE,mCAAmC,IAAI,IAAgC;GACrE;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA,eAAe;EACb,OAAO,iBAAiB,8BAA8B;EACtD,aAAa,iBAAiB,yCAAyC;EACvE,MAAM;EACN,cAAc;EACd,QAAQ,iBAAiB,oCAAoC;EAC7D,mCAAmC,IAAI,IAAgC;GACrE;GACA;GACA;GACA;EACF,CAAC;CACH;CACA,cAAc;EACZ,OAAO,iBAAiB,6BAA6B;EACrD,aAAa,iBAAiB,wCAAwC;EACtE,MAAM;EACN,cAAc;EACd,QAAQ,iBAAiB,oCAAoC;EAC7D,mCAAmC,IAAI,IAAgC,CAAC,cAAc,UAAU,CAAC;CACnG;CACA,UAAU;EACR,OAAO,iBAAiB,0BAA0B;EAClD,aAAa,iBAAiB,qCAAqC;EACnE,MAAM;EACN,cAAc;EACd,QAAQ,iBAAiB,uCAAuC;EAChE,mCAAmC,IAAI,IAAgC,CAAC,YAAY,UAAU,CAAC;CACjG;CACA,SAAS;EACP,OAAO;EACP,aAAa;EACb,MAAM;EACN,cAAc;EACd,QAAQ;EACR,mDAAmC,IAAI,IAAgC;CACzE;AACF,CAAwE;AAGxE,MAAa,oBAAoB,eAAqD;CAEpF,IAAI,gBAA0B,WAAW,QAAO,MAAK,MAAM,SAAS;CAGpE,IAAI,cAAc,SAAS,eAAe,KAAK,cAAc,SAAS,UAAU,GAAG;EACjF,gBAAgB,cAAc,QAAO,MAAK,MAAM,mBAAmB,MAAM,UAAU;EACnF,cAAc,QAAQ,wBAAwB;CAChD;CAEA,OAAO;AACT;AAEA,MAAa,qCACX,aACA,eACiF;CACjF,MAAM,QAAQ,YAAY,QAAQ,UAAU;CAE5C,IAAI,UAAU,IACZ,OAAO;EAAE,mBAAmB,EAAE,GAAG,mBAAmB,WAAW;EAAG,gBAAgB;CAAU;CAG9F,OAAO;EACL,mBAAmB,EAAE,GAAG,mBAAmB,YAAY;EACvD,gBACE,YAAY,SAAS,IAAI,EAAE,GAAG,mBAAmB,aAAa,QAAQ,KAAK,YAAY,SAAS,IAAI;CACxG;AACF;AAEA,MAAa,+BAA+B,OAAO,OAAO;CACxD,UAAU;CACV,KAAK;AACP,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import SvgEye from "../../icons/eye.js";
|
|
2
2
|
import { withCoreUserGuard } from "../../contexts/CoreUserContext.js";
|
|
3
3
|
import { localizationKeys } from "../../localization/localizationKeys.js";
|
|
4
|
+
import { usePrefersReducedMotion } from "../../hooks/usePrefersReducedMotion.js";
|
|
4
5
|
import { useSignOutContext } from "../../contexts/components/SignOut.js";
|
|
5
6
|
import { useLocalizations } from "../../localization/makeLocalizable.js";
|
|
6
7
|
import { useAppearance } from "../../customizables/AppearanceContext.js";
|
|
@@ -10,7 +11,8 @@ import { descriptors } from "../../customizables/elementDescriptors.js";
|
|
|
10
11
|
import { Col, Flex, Icon, Link, Text } from "../../customizables/index.js";
|
|
11
12
|
import { useMultipleSessions } from "../../hooks/useMultipleSessions.js";
|
|
12
13
|
import { Portal } from "../../elements/Portal.js";
|
|
13
|
-
import
|
|
14
|
+
import { useDragGesture } from "../../hooks/useDragGesture.js";
|
|
15
|
+
import { useEffect, useRef } from "react";
|
|
14
16
|
import { useClerk, useSession, useUser } from "@clerk/shared/react";
|
|
15
17
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
16
18
|
import { getFullName, getIdentifier } from "@clerk/shared/internal/clerk-js/user";
|
|
@@ -77,6 +79,7 @@ const ImpersonationFabInternal = () => {
|
|
|
77
79
|
const { t } = useLocalizations();
|
|
78
80
|
const { parsedInternalTheme } = useAppearance();
|
|
79
81
|
const containerRef = useRef(null);
|
|
82
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
80
83
|
const actor = session?.actor;
|
|
81
84
|
const agent = session?.agent;
|
|
82
85
|
const isImpersonating = !!actor && !agent;
|
|
@@ -86,6 +89,7 @@ const ImpersonationFabInternal = () => {
|
|
|
86
89
|
const rightProperty = "--cl-impersonation-fab-right";
|
|
87
90
|
const defaultTop = 109;
|
|
88
91
|
const defaultRight = 23;
|
|
92
|
+
const viewportInset = 20;
|
|
89
93
|
const handleResize = () => {
|
|
90
94
|
const current = containerRef.current;
|
|
91
95
|
if (!current) return;
|
|
@@ -101,22 +105,48 @@ const ImpersonationFabInternal = () => {
|
|
|
101
105
|
document.documentElement.style.setProperty(topProperty, `${defaultTop}px`);
|
|
102
106
|
}
|
|
103
107
|
};
|
|
104
|
-
const
|
|
105
|
-
window.addEventListener("pointermove", onPointerMove);
|
|
106
|
-
window.addEventListener("pointerup", () => {
|
|
107
|
-
window.removeEventListener("pointermove", onPointerMove);
|
|
108
|
-
handleResize();
|
|
109
|
-
}, { once: true });
|
|
110
|
-
};
|
|
111
|
-
const onPointerMove = React.useCallback((e) => {
|
|
112
|
-
e.stopPropagation();
|
|
113
|
-
e.preventDefault();
|
|
108
|
+
const settleIntoViewport = () => {
|
|
114
109
|
const current = containerRef.current;
|
|
115
110
|
if (!current) return;
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
const bounds = current.getBoundingClientRect();
|
|
112
|
+
const from = {
|
|
113
|
+
top: bounds.top,
|
|
114
|
+
offsetRight: window.innerWidth - bounds.right
|
|
115
|
+
};
|
|
116
|
+
const to = {
|
|
117
|
+
top: Math.min(Math.max(from.top, viewportInset), window.innerHeight - bounds.height - viewportInset),
|
|
118
|
+
offsetRight: Math.min(Math.max(from.offsetRight, viewportInset), window.innerWidth - bounds.width - viewportInset)
|
|
119
|
+
};
|
|
120
|
+
if (from.top === to.top && from.offsetRight === to.offsetRight) return;
|
|
121
|
+
document.documentElement.style.setProperty(rightProperty, `${to.offsetRight}px`);
|
|
122
|
+
document.documentElement.style.setProperty(topProperty, `${to.top}px`);
|
|
123
|
+
if (!prefersReducedMotion) current.animate([{
|
|
124
|
+
top: `${from.top}px`,
|
|
125
|
+
right: `${from.offsetRight}px`
|
|
126
|
+
}, {
|
|
127
|
+
top: `${to.top}px`,
|
|
128
|
+
right: `${to.offsetRight}px`
|
|
129
|
+
}], {
|
|
130
|
+
duration: 350,
|
|
131
|
+
easing: "cubic-bezier(0.34, 1.2, 0.64, 1)"
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const dragStart = useRef(null);
|
|
135
|
+
const onPointerDown = useDragGesture({
|
|
136
|
+
onDragStart: () => {
|
|
137
|
+
const bounds = containerRef.current?.getBoundingClientRect();
|
|
138
|
+
dragStart.current = bounds ? {
|
|
139
|
+
top: bounds.top,
|
|
140
|
+
offsetRight: window.innerWidth - bounds.right
|
|
141
|
+
} : null;
|
|
142
|
+
},
|
|
143
|
+
onDrag: ({ x, y }) => {
|
|
144
|
+
if (!dragStart.current) return;
|
|
145
|
+
document.documentElement.style.setProperty(rightProperty, `${dragStart.current.offsetRight - x}px`);
|
|
146
|
+
document.documentElement.style.setProperty(topProperty, `${dragStart.current.top + y}px`);
|
|
147
|
+
},
|
|
148
|
+
onDragEnd: settleIntoViewport
|
|
149
|
+
});
|
|
120
150
|
const repositionFabOnResize = () => {
|
|
121
151
|
window.addEventListener("resize", handleResize);
|
|
122
152
|
return () => {
|
|
@@ -141,7 +171,7 @@ const ImpersonationFabInternal = () => {
|
|
|
141
171
|
zIndex: t.zIndices.$fab,
|
|
142
172
|
boxShadow: t.shadows.$fabShadow,
|
|
143
173
|
borderRadius: t.radii.$halfHeight,
|
|
144
|
-
backgroundColor: t.colors.$
|
|
174
|
+
backgroundColor: t.colors.$colorBackground,
|
|
145
175
|
fontFamily: t.fonts.$main,
|
|
146
176
|
":hover": { cursor: "grab" },
|
|
147
177
|
":hover #cl-impersonationText": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Eye"],"sources":["../../../src/components/ImpersonationFab/index.tsx"],"sourcesContent":["import { getFullName, getIdentifier } from '@clerk/shared/internal/clerk-js/user';\nimport { useClerk, useSession, useUser } from '@clerk/shared/react';\nimport type { SignedInSessionResource } from '@clerk/shared/types';\nimport type { PointerEventHandler } from 'react';\nimport React, { useEffect, useRef } from 'react';\n\nimport { useSignOutContext, withCoreUserGuard } from '../../contexts';\nimport type { LocalizationKey } from '../../customizables';\nimport {\n Col,\n descriptors,\n Flex,\n Icon,\n Link,\n localizationKeys,\n Text,\n useAppearance,\n useLocalizations,\n} from '../../customizables';\nimport { Portal } from '../../elements/Portal';\nimport { useMultipleSessions } from '../../hooks/useMultipleSessions';\nimport { Eye } from '../../icons';\nimport type { PropsOfComponent } from '../../styledSystem';\nimport { InternalThemeProvider, mqu } from '../../styledSystem';\n\ntype EyeCircleProps = PropsOfComponent<typeof Col> & {\n width: string;\n height: string;\n};\n\nconst EyeCircle = ({ width, height, ...props }: EyeCircleProps) => {\n const { sx, ...rest } = props;\n return (\n <Col\n elementDescriptor={descriptors.impersonationFabIconContainer}\n center\n sx={[\n t => ({\n width,\n height,\n backgroundColor: t.colors.$danger500,\n borderRadius: t.radii.$circle,\n }),\n sx,\n ]}\n {...rest}\n >\n <Icon\n elementDescriptor={descriptors.impersonationFabIcon}\n icon={Eye}\n sx={t => ({\n color: t.colors.$white,\n })}\n size={'lg'}\n />\n </Col>\n );\n};\n\ntype FabContentProps = { title: LocalizationKey; signOutText: LocalizationKey };\n\nconst FabContent = ({ title, signOutText }: FabContentProps) => {\n const { session } = useSession();\n const { user } = useUser();\n const { signOut } = useClerk();\n const { otherSessions } = useMultipleSessions({ user });\n const { navigateAfterSignOut, navigateAfterMultiSessionSingleSignOutUrl } = useSignOutContext();\n\n const handleSignOutSessionClicked = (session: SignedInSessionResource) => () => {\n if (otherSessions.length === 0) {\n return signOut(navigateAfterSignOut);\n }\n return signOut(navigateAfterMultiSessionSingleSignOutUrl, { sessionId: session.id });\n };\n\n return (\n <Col\n sx={t => ({\n width: '100%',\n paddingInlineStart: t.sizes.$4,\n paddingInlineEnd: t.sizes.$6,\n whiteSpace: 'nowrap',\n })}\n >\n <Text\n colorScheme='secondary'\n elementDescriptor={descriptors.impersonationFabTitle}\n variant='buttonLarge'\n truncate\n localizationKey={title}\n />\n <Link\n variant='buttonLarge'\n elementDescriptor={descriptors.impersonationFabActionLink}\n sx={t => ({\n alignSelf: 'flex-start',\n color: t.colors.$primary500,\n ':hover': {\n cursor: 'pointer',\n },\n })}\n localizationKey={signOutText}\n onClick={\n // clerk-js has been loaded at this point so we can safely access session\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n handleSignOutSessionClicked(session!)\n }\n />\n </Col>\n );\n};\n\nconst ImpersonationFabInternal = () => {\n const { session } = useSession();\n const { t } = useLocalizations();\n const { parsedInternalTheme } = useAppearance();\n const containerRef = useRef<HTMLDivElement>(null);\n const actor = session?.actor;\n const agent = session?.agent;\n const isImpersonating = !!actor && !agent;\n\n //essentials for calcs\n const eyeWidth = parsedInternalTheme.sizes.$16;\n const eyeHeight = eyeWidth;\n const topProperty = '--cl-impersonation-fab-top';\n const rightProperty = '--cl-impersonation-fab-right';\n const defaultTop = 109;\n const defaultRight = 23;\n\n const handleResize = () => {\n const current = containerRef.current;\n if (!current) {\n return;\n }\n\n const offsetRight = window.innerWidth - current.offsetLeft - current.offsetWidth;\n const offsetBottom = window.innerHeight - current.offsetTop - current.offsetHeight;\n\n const outsideViewport = [current.offsetLeft, offsetRight, current.offsetTop, offsetBottom].some(o => o < 0);\n\n if (outsideViewport) {\n document.documentElement.style.setProperty(rightProperty, `${defaultRight}px`);\n document.documentElement.style.setProperty(topProperty, `${defaultTop}px`);\n }\n };\n\n const onPointerDown: PointerEventHandler = () => {\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener(\n 'pointerup',\n () => {\n window.removeEventListener('pointermove', onPointerMove);\n handleResize();\n },\n { once: true },\n );\n };\n\n const onPointerMove = React.useCallback((e: PointerEvent) => {\n e.stopPropagation();\n e.preventDefault();\n const current = containerRef.current;\n if (!current) {\n return;\n }\n const rightOffestBasedOnViewportAndContent = `${\n window.innerWidth - current.offsetLeft - current.offsetWidth - e.movementX\n }px`;\n document.documentElement.style.setProperty(rightProperty, rightOffestBasedOnViewportAndContent);\n document.documentElement.style.setProperty(topProperty, `${current.offsetTop - -e.movementY}px`);\n }, []);\n\n const repositionFabOnResize = () => {\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n };\n\n useEffect(repositionFabOnResize, []);\n\n if (!isImpersonating || !session.user) {\n return null;\n }\n\n const title = localizationKeys('impersonationFab.title', {\n identifier: getFullName(session.user) || getIdentifier(session.user),\n });\n const titleLength = t(title).length;\n\n return (\n <Portal>\n <Flex\n ref={containerRef}\n elementDescriptor={descriptors.impersonationFab}\n onPointerDown={onPointerDown}\n align='center'\n sx={t => ({\n touchAction: 'none', //for drag to work on mobile consistently\n position: 'fixed',\n overflow: 'hidden',\n top: `var(${topProperty}, ${defaultTop}px)`,\n // eslint-disable-next-line custom-rules/no-physical-css-properties -- Complex JS-based positioning via CSS custom properties\n right: `var(${rightProperty}, ${defaultRight}px)`,\n zIndex: t.zIndices.$fab,\n boxShadow: t.shadows.$fabShadow,\n borderRadius: t.radii.$halfHeight, //to match the circular eye perfectly\n backgroundColor: t.colors.$white,\n fontFamily: t.fonts.$main,\n ':hover': {\n cursor: 'grab',\n },\n ':hover #cl-impersonationText': {\n transition: `max-width ${t.transitionDuration.$slowest} ease, opacity ${t.transitionDuration.$slower} ease ${t.transitionDuration.$slowest}`,\n maxWidth: `min(calc(50vw - ${eyeWidth} - 2 * ${defaultRight}px), ${titleLength}ch)`,\n [mqu.md]: {\n maxWidth: `min(calc(100vw - ${eyeWidth} - 2 * ${defaultRight}px), ${titleLength}ch)`,\n },\n opacity: 1,\n },\n ':hover #cl-impersonationEye': {\n transform: 'rotate(-180deg)',\n },\n })}\n >\n <EyeCircle\n id='cl-impersonationEye'\n width={eyeWidth}\n height={eyeHeight}\n sx={t => ({\n transition: `transform ${t.transitionDuration.$slowest} ease`,\n })}\n />\n\n <Flex\n id='cl-impersonationText'\n sx={t => ({\n transition: `max-width ${t.transitionDuration.$slowest} ease, opacity ${t.transitionDuration.$fast} ease`,\n maxWidth: '0px',\n opacity: 0,\n })}\n >\n <FabContent\n title={title}\n signOutText={localizationKeys('impersonationFab.action__signOut')}\n />\n </Flex>\n </Flex>\n </Portal>\n );\n};\n\nexport const ImpersonationFab = withCoreUserGuard(() => (\n <InternalThemeProvider>\n <ImpersonationFabInternal />\n </InternalThemeProvider>\n));\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,MAAM,aAAa,EAAE,OAAO,QAAQ,GAAG,YAA4B;CACjE,MAAM,EAAE,IAAI,GAAG,SAAS;CACxB,OACE,oBAAC,KAAD;EACE,mBAAmB,YAAY;EAC/B;EACA,IAAI,EACF,OAAM;GACJ;GACA;GACA,iBAAiB,EAAE,OAAO;GAC1B,cAAc,EAAE,MAAM;EACxB,IACA,EACF;EACA,GAAI;YAEJ,oBAAC,MAAD;GACE,mBAAmB,YAAY;GAC/B,MAAMA;GACN,KAAI,OAAM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AAC,CAAC;CAE7B,OACE,oBAAC,QAAD,YACE,qBAAC,MAAD;EACE,KAAK;EACL,mBAAmB,YAAY;EAChB;EACf,OAAM;EACN,KAAI,OAAM;GACR,aAAa;GACb,UAAU;GACV,UAAU;GACV,KAAK,OAAO,YAAY,IAAI,WAAW;GAEvC,OAAO,OAAO,cAAc,IAAI,aAAa;GAC7C,QAAQ,EAAE,SAAS;GACnB,WAAW,EAAE,QAAQ;GACrB,cAAc,EAAE,MAAM;GACtB,iBAAiB,EAAE,OAAO;GAC1B,YAAY,EAAE,MAAM;GACpB,UAAU,EACR,QAAQ,OACV;GACA,gCAAgC;IAC9B,YAAY,aAAa,EAAE,mBAAmB,SAAS,iBAAiB,EAAE,mBAAmB,QAAQ,QAAQ,EAAE,mBAAmB;IAClI,UAAU,mBAAmB,SAAS,SAAS,aAAa,OAAO,YAAY;KAC9E,IAAI,KAAK,EACR,UAAU,oBAAoB,SAAS,SAAS,aAAa,OAAO,YAAY,KAClF;IACA,SAAS;GACX;GACA,+BAA+B,EAC7B,WAAW,kBACb;EACF;YA/BF,CAiCE,oBAAC,WAAD;GACE,IAAG;GACH,OAAO;GACP,QAAQ;GACR,KAAI,OAAM,EACR,YAAY,aAAa,EAAE,mBAAmB,SAAS,OACzD;EACD,IAED,oBAAC,MAAD;GACE,IAAG;GACH,KAAI,OAAM;IACR,YAAY,aAAa,EAAE,mBAAmB,SAAS,iBAAiB,EAAE,mBAAmB,MAAM;IACnG,UAAU;IACV,SAAS;GACX;aAEA,oBAAC,YAAD;IACS;IACP,aAAa,iBAAiB,kCAAkC;GACjE;EACG,EACF;IACA;AAEZ;AAEA,MAAa,mBAAmB,wBAC9B,oBAAC,uBAAD,YACE,oBAAC,0BAAD,CAA2B,GACN,EACxB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Eye"],"sources":["../../../src/components/ImpersonationFab/index.tsx"],"sourcesContent":["import { getFullName, getIdentifier } from '@clerk/shared/internal/clerk-js/user';\nimport { useClerk, useSession, useUser } from '@clerk/shared/react';\nimport type { SignedInSessionResource } from '@clerk/shared/types';\nimport { useEffect, useRef } from 'react';\n\nimport { useSignOutContext, withCoreUserGuard } from '../../contexts';\nimport type { LocalizationKey } from '../../customizables';\nimport {\n Col,\n descriptors,\n Flex,\n Icon,\n Link,\n localizationKeys,\n Text,\n useAppearance,\n useLocalizations,\n} from '../../customizables';\nimport { Portal } from '../../elements/Portal';\nimport { useDragGesture } from '../../hooks/useDragGesture';\nimport { useMultipleSessions } from '../../hooks/useMultipleSessions';\nimport { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';\nimport { Eye } from '../../icons';\nimport type { PropsOfComponent } from '../../styledSystem';\nimport { InternalThemeProvider, mqu } from '../../styledSystem';\n\ntype EyeCircleProps = PropsOfComponent<typeof Col> & {\n width: string;\n height: string;\n};\n\nconst EyeCircle = ({ width, height, ...props }: EyeCircleProps) => {\n const { sx, ...rest } = props;\n return (\n <Col\n elementDescriptor={descriptors.impersonationFabIconContainer}\n center\n sx={[\n t => ({\n width,\n height,\n backgroundColor: t.colors.$danger500,\n borderRadius: t.radii.$circle,\n }),\n sx,\n ]}\n {...rest}\n >\n <Icon\n elementDescriptor={descriptors.impersonationFabIcon}\n icon={Eye}\n sx={t => ({\n color: t.colors.$white,\n })}\n size={'lg'}\n />\n </Col>\n );\n};\n\ntype FabContentProps = { title: LocalizationKey; signOutText: LocalizationKey };\n\nconst FabContent = ({ title, signOutText }: FabContentProps) => {\n const { session } = useSession();\n const { user } = useUser();\n const { signOut } = useClerk();\n const { otherSessions } = useMultipleSessions({ user });\n const { navigateAfterSignOut, navigateAfterMultiSessionSingleSignOutUrl } = useSignOutContext();\n\n const handleSignOutSessionClicked = (session: SignedInSessionResource) => () => {\n if (otherSessions.length === 0) {\n return signOut(navigateAfterSignOut);\n }\n return signOut(navigateAfterMultiSessionSingleSignOutUrl, { sessionId: session.id });\n };\n\n return (\n <Col\n sx={t => ({\n width: '100%',\n paddingInlineStart: t.sizes.$4,\n paddingInlineEnd: t.sizes.$6,\n whiteSpace: 'nowrap',\n })}\n >\n <Text\n colorScheme='secondary'\n elementDescriptor={descriptors.impersonationFabTitle}\n variant='buttonLarge'\n truncate\n localizationKey={title}\n />\n <Link\n variant='buttonLarge'\n elementDescriptor={descriptors.impersonationFabActionLink}\n sx={t => ({\n alignSelf: 'flex-start',\n color: t.colors.$primary500,\n ':hover': {\n cursor: 'pointer',\n },\n })}\n localizationKey={signOutText}\n onClick={\n // clerk-js has been loaded at this point so we can safely access session\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n handleSignOutSessionClicked(session!)\n }\n />\n </Col>\n );\n};\n\nconst ImpersonationFabInternal = () => {\n const { session } = useSession();\n const { t } = useLocalizations();\n const { parsedInternalTheme } = useAppearance();\n const containerRef = useRef<HTMLDivElement>(null);\n const prefersReducedMotion = usePrefersReducedMotion();\n const actor = session?.actor;\n const agent = session?.agent;\n const isImpersonating = !!actor && !agent;\n\n //essentials for calcs\n const eyeWidth = parsedInternalTheme.sizes.$16;\n const eyeHeight = eyeWidth;\n const topProperty = '--cl-impersonation-fab-top';\n const rightProperty = '--cl-impersonation-fab-right';\n const defaultTop = 109;\n const defaultRight = 23;\n const viewportInset = 20;\n\n const handleResize = () => {\n const current = containerRef.current;\n if (!current) {\n return;\n }\n\n const offsetRight = window.innerWidth - current.offsetLeft - current.offsetWidth;\n const offsetBottom = window.innerHeight - current.offsetTop - current.offsetHeight;\n\n const outsideViewport = [current.offsetLeft, offsetRight, current.offsetTop, offsetBottom].some(o => o < 0);\n\n if (outsideViewport) {\n document.documentElement.style.setProperty(rightProperty, `${defaultRight}px`);\n document.documentElement.style.setProperty(topProperty, `${defaultTop}px`);\n }\n };\n\n const settleIntoViewport = () => {\n const current = containerRef.current;\n if (!current) {\n return;\n }\n\n const bounds = current.getBoundingClientRect();\n const from = { top: bounds.top, offsetRight: window.innerWidth - bounds.right };\n const to = {\n top: Math.min(Math.max(from.top, viewportInset), window.innerHeight - bounds.height - viewportInset),\n offsetRight: Math.min(\n Math.max(from.offsetRight, viewportInset),\n window.innerWidth - bounds.width - viewportInset,\n ),\n };\n if (from.top === to.top && from.offsetRight === to.offsetRight) {\n return;\n }\n\n document.documentElement.style.setProperty(rightProperty, `${to.offsetRight}px`);\n document.documentElement.style.setProperty(topProperty, `${to.top}px`);\n if (!prefersReducedMotion) {\n current.animate(\n [\n // eslint-disable-next-line custom-rules/no-physical-css-properties -- Complex JS-based positioning via CSS custom properties\n { top: `${from.top}px`, right: `${from.offsetRight}px` },\n // eslint-disable-next-line custom-rules/no-physical-css-properties -- Complex JS-based positioning via CSS custom properties\n { top: `${to.top}px`, right: `${to.offsetRight}px` },\n ],\n { duration: 350, easing: 'cubic-bezier(0.34, 1.2, 0.64, 1)' },\n );\n }\n };\n\n const dragStart = useRef<{ top: number; offsetRight: number } | null>(null);\n const onPointerDown = useDragGesture({\n onDragStart: () => {\n const bounds = containerRef.current?.getBoundingClientRect();\n dragStart.current = bounds ? { top: bounds.top, offsetRight: window.innerWidth - bounds.right } : null;\n },\n onDrag: ({ x, y }) => {\n if (!dragStart.current) {\n return;\n }\n document.documentElement.style.setProperty(rightProperty, `${dragStart.current.offsetRight - x}px`);\n document.documentElement.style.setProperty(topProperty, `${dragStart.current.top + y}px`);\n },\n onDragEnd: settleIntoViewport,\n });\n\n const repositionFabOnResize = () => {\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n };\n\n useEffect(repositionFabOnResize, []);\n\n if (!isImpersonating || !session.user) {\n return null;\n }\n\n const title = localizationKeys('impersonationFab.title', {\n identifier: getFullName(session.user) || getIdentifier(session.user),\n });\n const titleLength = t(title).length;\n\n return (\n <Portal>\n <Flex\n ref={containerRef}\n elementDescriptor={descriptors.impersonationFab}\n onPointerDown={onPointerDown}\n align='center'\n sx={t => ({\n touchAction: 'none', //for drag to work on mobile consistently\n position: 'fixed',\n overflow: 'hidden',\n top: `var(${topProperty}, ${defaultTop}px)`,\n // eslint-disable-next-line custom-rules/no-physical-css-properties -- Complex JS-based positioning via CSS custom properties\n right: `var(${rightProperty}, ${defaultRight}px)`,\n zIndex: t.zIndices.$fab,\n boxShadow: t.shadows.$fabShadow,\n borderRadius: t.radii.$halfHeight, //to match the circular eye perfectly\n backgroundColor: t.colors.$colorBackground,\n fontFamily: t.fonts.$main,\n ':hover': {\n cursor: 'grab',\n },\n ':hover #cl-impersonationText': {\n transition: `max-width ${t.transitionDuration.$slowest} ease, opacity ${t.transitionDuration.$slower} ease ${t.transitionDuration.$slowest}`,\n maxWidth: `min(calc(50vw - ${eyeWidth} - 2 * ${defaultRight}px), ${titleLength}ch)`,\n [mqu.md]: {\n maxWidth: `min(calc(100vw - ${eyeWidth} - 2 * ${defaultRight}px), ${titleLength}ch)`,\n },\n opacity: 1,\n },\n ':hover #cl-impersonationEye': {\n transform: 'rotate(-180deg)',\n },\n })}\n >\n <EyeCircle\n id='cl-impersonationEye'\n width={eyeWidth}\n height={eyeHeight}\n sx={t => ({\n transition: `transform ${t.transitionDuration.$slowest} ease`,\n })}\n />\n\n <Flex\n id='cl-impersonationText'\n sx={t => ({\n transition: `max-width ${t.transitionDuration.$slowest} ease, opacity ${t.transitionDuration.$fast} ease`,\n maxWidth: '0px',\n opacity: 0,\n })}\n >\n <FabContent\n title={title}\n signOutText={localizationKeys('impersonationFab.action__signOut')}\n />\n </Flex>\n </Flex>\n </Portal>\n );\n};\n\nexport const ImpersonationFab = withCoreUserGuard(() => (\n <InternalThemeProvider>\n <ImpersonationFabInternal />\n </InternalThemeProvider>\n));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,aAAa,EAAE,OAAO,QAAQ,GAAG,YAA4B;CACjE,MAAM,EAAE,IAAI,GAAG,SAAS;CACxB,OACE,oBAAC,KAAD;EACE,mBAAmB,YAAY;EAC/B;EACA,IAAI,EACF,OAAM;GACJ;GACA;GACA,iBAAiB,EAAE,OAAO;GAC1B,cAAc,EAAE,MAAM;EACxB,IACA,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ACR,QAAQ,OACV;GACA,gCAAgC;IAC9B,YAAY,aAAa,EAAE,mBAAmB,SAAS,iBAAiB,EAAE,mBAAmB,QAAQ,QAAQ,EAAE,mBAAmB;IAClI,UAAU,mBAAmB,SAAS,SAAS,aAAa,OAAO,YAAY;KAC9E,IAAI,KAAK,EACR,UAAU,oBAAoB,SAAS,SAAS,aAAa,OAAO,YAAY,KAClF;IACA,SAAS;GACX;GACA,+BAA+B,EAC7B,WAAW,kBACb;EACF;YA/BF,CAiCE,oBAAC,WAAD;GACE,IAAG;GACH,OAAO;GACP,QAAQ;GACR,KAAI,OAAM,EACR,YAAY,aAAa,EAAE,mBAAmB,SAAS,OACzD;EACD,IAED,oBAAC,MAAD;GACE,IAAG;GACH,KAAI,OAAM;IACR,YAAY,aAAa,EAAE,mBAAmB,SAAS,iBAAiB,EAAE,mBAAmB,MAAM;IACnG,UAAU;IACV,SAAS;GACX;aAEA,oBAAC,YAAD;IACS;IACP,aAAa,iBAAiB,kCAAkC;GACjE;EACG,EACF;IACA;AAEZ;AAEA,MAAa,mBAAmB,wBAC9B,oBAAC,uBAAD,YACE,oBAAC,0BAAD,CAA2B,GACN,EACxB"}
|
|
@@ -435,7 +435,7 @@ function SignInStartInternal() {
|
|
|
435
435
|
onActionClicked: switchToNextIdentifier,
|
|
436
436
|
...identifierFieldProps,
|
|
437
437
|
autoFocus: shouldAutofocus,
|
|
438
|
-
autoComplete: isWebAuthnAutofillSupported ?
|
|
438
|
+
autoComplete: isWebAuthnAutofillSupported ? `${currentIdentifier.autoComplete} webauthn` : currentIdentifier.autoComplete,
|
|
439
439
|
isLastAuthenticationStrategy: isIdentifierLastAuthenticationStrategy
|
|
440
440
|
})
|
|
441
441
|
}), /* @__PURE__ */ jsx(InstantPasswordRow, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInStart.js","names":[],"sources":["../../../src/components/SignIn/SignInStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { inertProps } from '@clerk/shared/inert';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { clerkInvalidFAPIResponse } from '@clerk/shared/internal/clerk-js/errors';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type {\n ClerkAPIError,\n PhoneCodeChannel,\n PhoneCodeChannelData,\n SignInCreateParams,\n SignInResource,\n} from '@clerk/shared/types';\nimport { isWebAuthnAutofillSupported } from '@clerk/shared/webauthn';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { actionBlockedDetailsFrom } from '@/ui/utils/actionBlocked';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { isMobileDevice } from '@/ui/utils/isMobileDevice';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\n\nimport type { SignInStartIdentifier } from '../../common';\nimport {\n ActionBlockedCard,\n getIdentifierControlDisplayValues,\n groupIdentifiers,\n withRedirectToAfterSignIn,\n withRedirectToSignInTask,\n} from '../../common';\nimport { useCoreSignIn, useEnvironment, useSignInContext } from '../../contexts';\nimport { Col, descriptors, Flow, localizationKeys } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useIsWebAuthnSupported, useLoadingStatus } from '../../hooks';\nimport { useSupportEmail } from '../../hooks/useSupportEmail';\nimport { useTotalEnabledAuthMethods } from '../../hooks/useTotalEnabledAuthMethods';\nimport { useRouter } from '../../router';\nimport {\n hasOnlyEnterpriseSSOFirstFactors,\n shouldHandOffToEnterpriseConnection,\n shouldHandOffUnidentifiedToEnterpriseConnection,\n} from './enterpriseSSOFactors';\nimport { handleCombinedFlowTransfer } from './handleCombinedFlowTransfer';\nimport { isProtectCheckRequiredError, navigateOnSignInProtectGate } from './handleProtectCheck';\nimport { SIGN_IN_RESET_PASSWORD_INTENT_PARAM, useHandleAuthenticateWithPasskey } from './shared';\nimport { SignInAlternativePhoneCodePhoneNumberCard } from './SignInAlternativePhoneCodePhoneNumberCard';\nimport { SignInSocialButtons } from './SignInSocialButtons';\nimport {\n getPreferredAlternativePhoneChannel,\n getPreferredAlternativePhoneChannelForCombinedFlow,\n getSignUpAttributeFromIdentifier,\n} from './utils';\n\nconst useAutoFillPasskey = () => {\n const [isSupported, setIsSupported] = useState(false);\n const { navigate } = useRouter();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor, 'protect-check');\n const { userSettings } = useEnvironment();\n const { passkeySettings, attributes } = userSettings;\n // @ts-expect-error - This is not a public API\n const { __internal_isWebAuthnAutofillSupported } = useClerk();\n\n useEffect(() => {\n async function runAutofillPasskey() {\n const _isSupported = await (__internal_isWebAuthnAutofillSupported ?? isWebAuthnAutofillSupported)();\n setIsSupported(_isSupported);\n if (!_isSupported) {\n return;\n }\n\n await authenticateWithPasskey({ flow: 'autofill' });\n }\n\n if (passkeySettings.allow_autofill && attributes.passkey?.enabled) {\n runAutofillPasskey();\n }\n }, []);\n\n return {\n isWebAuthnAutofillSupported: isSupported,\n };\n};\n\nfunction SignInStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const { userSettings, authConfig } = useEnvironment();\n const signIn = useCoreSignIn();\n const { navigate } = useRouter();\n const ctx = useSignInContext();\n const { afterSignInUrl, signUpUrl, waitlistUrl, isCombinedFlow, signUpIfMissingEnabled, navigateOnSetActive } = ctx;\n const supportEmail = useSupportEmail();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const identifierAttributes = useMemo<SignInStartIdentifier[]>(\n () => groupIdentifiers(userSettings.enabledFirstFactorIdentifiers),\n [userSettings.enabledFirstFactorIdentifiers],\n );\n const alternativePhoneCodeChannels = userSettings.alternativePhoneCodeChannels;\n\n /**\n * Passkeys\n */\n const { isWebAuthnAutofillSupported } = useAutoFillPasskey();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor, 'protect-check');\n const isWebSupported = useIsWebAuthnSupported();\n\n const onlyPhoneNumberInitialValueExists =\n !!ctx.initialValues?.phoneNumber && !(ctx.initialValues.emailAddress || ctx.initialValues.username);\n const shouldStartWithPhoneNumberIdentifier =\n onlyPhoneNumberInitialValueExists && identifierAttributes.includes('phone_number');\n const [identifierAttribute, setIdentifierAttribute] = useState<SignInStartIdentifier>(\n shouldStartWithPhoneNumberIdentifier ? 'phone_number' : identifierAttributes[0] || '',\n );\n const [hasSwitchedByAutofill, setHasSwitchedByAutofill] = useState(false);\n\n const organizationTicket = getClerkQueryParam('__clerk_ticket') || '';\n const clerkStatus = getClerkQueryParam('__clerk_status') || '';\n\n const standardFormAttributes = userSettings.enabledFirstFactorIdentifiers;\n const web3FirstFactors = userSettings.web3FirstFactors;\n const authenticatableSocialStrategies = userSettings.authenticatableSocialStrategies;\n const passwordBasedInstance = userSettings.instanceIsPasswordBased;\n const { currentIdentifier, nextIdentifier } = getIdentifierControlDisplayValues(\n identifierAttributes,\n identifierAttribute,\n );\n const instantPasswordField = useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__password') as any,\n });\n\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = useState<PhoneCodeChannelData | null>(null);\n\n const showAlternativePhoneCodeProviders = userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const provider: PhoneCodeChannelData | null = getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(provider);\n };\n\n const ctxInitialValues = ctx.initialValues || {};\n const initialValues: Record<SignInStartIdentifier, string | undefined> = useMemo(\n () => ({\n email_address: ctxInitialValues.emailAddress,\n email_address_username: ctxInitialValues.emailAddress || ctxInitialValues.username,\n username: ctxInitialValues.username,\n phone_number: ctxInitialValues.phoneNumber,\n }),\n [ctx.initialValues],\n );\n\n const hasSocialOrWeb3Buttons =\n !!authenticatableSocialStrategies.length || !!web3FirstFactors.length || !!alternativePhoneCodeChannels.length;\n const [shouldAutofocus, setShouldAutofocus] = useState(!isMobileDevice() && !hasSocialOrWeb3Buttons);\n // When the captcha escalates to an interactive challenge, spotlight it by collapsing/inerting the\n // rest of the card (see the descriptors.main column below).\n const [captchaIsInteractive, setCaptchaIsInteractive] = useState(false);\n const textIdentifierField = useFormControl('identifier', initialValues[identifierAttribute] || '', {\n ...currentIdentifier,\n isRequired: true,\n transformer: value => value.trim(),\n });\n\n const phoneIdentifierField = useFormControl('identifier', initialValues['phone_number'] || '', {\n ...currentIdentifier,\n isRequired: true,\n });\n\n const identifierField = identifierAttribute === 'phone_number' ? phoneIdentifierField : textIdentifierField;\n\n const switchToNextIdentifier = () => {\n setIdentifierAttribute(\n i => identifierAttributes[(identifierAttributes.indexOf(i) + 1) % identifierAttributes.length],\n );\n setShouldAutofocus(true);\n setHasSwitchedByAutofill(false);\n };\n\n const handlePhoneNumberPaste = (value: string) => {\n textIdentifierField.setValue(initialValues[identifierAttribute] || '');\n phoneIdentifierField.setValue(value);\n setIdentifierAttribute('phone_number');\n setShouldAutofocus(true);\n };\n\n // switch to the phone input (if available) if a \"+\" is entered\n // (either by the browser or the user)\n // this does not work in chrome as it does not fire the change event and the value is\n // not available via js\n useLayoutEffect(() => {\n if (\n identifierField.value.startsWith('+') &&\n identifierAttributes.includes('phone_number') &&\n identifierAttribute !== 'phone_number' &&\n !hasSwitchedByAutofill\n ) {\n handlePhoneNumberPaste(identifierField.value);\n // do not switch automatically on subsequent autofills\n // by the browser to avoid a switch loop\n setHasSwitchedByAutofill(true);\n }\n }, [identifierField.value, identifierAttributes]);\n\n useEffect(() => {\n if (!organizationTicket) {\n return;\n }\n\n if (clerkStatus === 'sign_up') {\n const paramsToForward = new URLSearchParams();\n if (organizationTicket) {\n paramsToForward.set('__clerk_ticket', organizationTicket);\n }\n // We explicitly navigate to 'create' in the combined flow to trigger a client-side navigation. Navigating to\n // signUpUrl triggers a full page reload when used with the hash router.\n void navigate(isCombinedFlow ? `create` : signUpUrl, { searchParams: paramsToForward });\n return;\n }\n\n status.setLoading();\n card.setLoading();\n signIn\n .create({\n strategy: 'ticket',\n ticket: organizationTicket,\n })\n .then(res => {\n if (navigateOnSignInProtectGate(res, navigate, 'protect-check')) {\n return;\n }\n switch (res.status) {\n case 'needs_first_factor': {\n if (!shouldHandOffToEnterpriseConnection(res)) {\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n removeClerkQueryParam('__clerk_ticket');\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n })\n .catch(err => {\n return attemptToRecoverFromSignInError(err);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = !!hasOnlyEnterpriseSSOFirstFactors(signIn);\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n }, []);\n\n useEffect(() => {\n async function handleOauthError() {\n const defaultErrorHandler = () => {\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n };\n\n const error = signIn?.firstFactorVerification?.error;\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.EXTERNAL_ACCOUNT_NOT_FOUND:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED_WAITLIST:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n defaultErrorHandler();\n }\n\n // TODO: This is a workaround in order to reset the sign in attempt\n // so that the oauth error does not persist on full page reloads.\n void (await signIn.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const buildSignInParams = (fields: Array<FormControlState<string>>): SignInCreateParams => {\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n\n /**\n * FAPI will return an error when password is submitted but the user's email matches requires enterprise sso authentication.\n * We need to strip password from the create request, and reconstruct it later.\n */\n if (!hasPassword || userSettings.enterpriseSSO.enabled) {\n fields = fields.filter(f => f.name !== 'password');\n }\n return {\n ...buildRequest(fields),\n ...(hasPassword && !userSettings.enterpriseSSO.enabled && { strategy: 'password' }),\n } as SignInCreateParams;\n };\n\n const safePasswordSignInForEnterpriseSSOInstance = (\n signInCreatePromise: Promise<SignInResource>,\n fields: Array<FormControlState<string>>,\n ) => {\n return signInCreatePromise.then(signInResource => {\n if (!userSettings.enterpriseSSO.enabled) {\n return signInResource;\n }\n /**\n * For instances with Enterprise SSO enabled, perform sign in with password only when it is allowed for the identified user.\n */\n const passwordField = fields.find(f => f.name === 'password')?.value;\n if (!passwordField || signInResource.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n return signInResource;\n }\n return signInResource.attemptFirstFactor({ strategy: 'password', password: passwordField });\n });\n };\n\n const signInWithFields = async (\n fields: Array<FormControlState<string>>,\n options?: { resetPasswordIntent?: boolean },\n ) => {\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fields, authConfig.preferredChannels, 'identifier');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign in request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fields.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fields.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n try {\n // On top of the context-level preconditions, sign-up-if-missing only\n // supports identifiers that can be verified out-of-band.\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n const signUpAttribute = getSignUpAttributeFromIdentifier(identifierField);\n const shouldSignUpIfMissing = signUpIfMissingEnabled && signUpAttribute !== 'username' && !hasPassword;\n\n const res = await safePasswordSignInForEnterpriseSSOInstance(\n signIn.create({\n ...buildSignInParams(fields),\n ...(shouldSignUpIfMissing && { signUpIfMissing: true }),\n }),\n fields,\n );\n\n if (navigateOnSignInProtectGate(res, navigate, 'protect-check')) {\n return;\n }\n\n switch (res.status) {\n case 'needs_identifier':\n // Check if we need to initiate an enterprise sso flow\n if (shouldHandOffUnidentifiedToEnterpriseConnection(res)) {\n await authenticateWithEnterpriseSSO();\n }\n break;\n case 'needs_first_factor': {\n if (!shouldHandOffToEnterpriseConnection(res)) {\n if (options?.resetPasswordIntent) {\n return navigate('factor-one', {\n searchParams: new URLSearchParams({ [SIGN_IN_RESET_PASSWORD_INTENT_PARAM]: 'true' }),\n });\n }\n return navigate('factor-one');\n }\n\n // Awaited so a failed hand-off reaches the catch below instead of escaping this try.\n return await authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n } catch (e: any) {\n return attemptToRecoverFromSignInError(e);\n }\n };\n\n const authenticateWithEnterpriseSSO = async () => {\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignInUrl || '/';\n\n try {\n await signIn.authenticateWithRedirect({\n strategy: 'enterprise_sso',\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n continueSignIn: true,\n });\n } catch (err) {\n // Preparing the hand-off can itself raise a challenge. No redirect was issued and the sign-in\n // is sitting on the gate instead. Handled here because the callers' recovery path drops\n // errors that didn't come from the API.\n if (isProtectCheckRequiredError(err) && navigateOnSignInProtectGate(signIn, navigate, 'protect-check')) {\n return;\n }\n throw err;\n }\n };\n\n const attemptToRecoverFromSignInError = async (e: any) => {\n if (!e.errors) {\n return;\n }\n const instantPasswordError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVALID_STRATEGY_FOR_USER ||\n e.code === ERROR_CODES.FORM_PASSWORD_INCORRECT ||\n e.code === ERROR_CODES.FORM_PASSWORD_PWNED,\n );\n\n const sessionAlreadyExistsError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === ERROR_CODES.SESSION_EXISTS,\n );\n const alreadySignedInError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === 'identifier_already_signed_in',\n );\n const accountDoesNotExistError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVITATION_ACCOUNT_NOT_EXISTS || e.code === ERROR_CODES.FORM_IDENTIFIER_NOT_FOUND,\n );\n\n if (instantPasswordError) {\n await signInWithFields([identifierField]);\n } else if (sessionAlreadyExistsError) {\n await clerk.setActive({\n session: clerk.client.lastActiveSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (alreadySignedInError) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sid = alreadySignedInError.meta!.sessionId!;\n await clerk.setActive({\n session: sid,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (isCombinedFlow && accountDoesNotExistError) {\n const attribute = getSignUpAttributeFromIdentifier(identifierField);\n\n if (userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST) {\n const waitlistUrl = clerk.buildWaitlistUrl(\n attribute === 'emailAddress'\n ? {\n initialValues: {\n [attribute]: identifierField.value,\n },\n }\n : {},\n );\n return navigate(waitlistUrl);\n }\n\n clerk.client.signUp[attribute] = identifierField.value;\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return handleCombinedFlowTransfer({\n afterSignUpUrl: ctx.afterSignUpUrl || '/',\n clerk,\n handleError: e => handleError(e, [identifierField, instantPasswordField], card.setError),\n identifierAttribute: attribute,\n identifierValue: identifierField.value,\n navigate,\n organizationTicket,\n signUpMode: userSettings.signUp.mode,\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n navigateOnSetActive,\n passwordEnabled: userSettings.attributes.password?.required ?? false,\n alternativePhoneCodeChannel:\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannelForCombinedFlow(\n authConfig.preferredChannels,\n attribute,\n identifierField.value,\n ),\n unsafeMetadata: ctx.unsafeMetadata,\n });\n } else {\n handleError(e, [identifierField, instantPasswordField], card.setError);\n }\n };\n\n const handleFirstPartySubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n return signInWithFields([identifierField, instantPasswordField]);\n };\n\n const handleForgotPasswordClick: React.MouseEventHandler = e => {\n e.preventDefault();\n // Surface the same native required-field validation as the Continue button\n // when the identifier is missing\n const form = e.currentTarget.closest('form');\n if (form && !form.reportValidity()) {\n return;\n }\n void signInWithFields([identifierField], { resetPasswordIntent: true });\n };\n\n const DynamicField = useMemo(() => {\n const components = {\n tel: Form.PhoneInput,\n password: Form.PasswordInput,\n text: Form.PlainInput,\n email: Form.PlainInput,\n };\n\n return components[identifierField.type as keyof typeof components];\n }, [identifierField.type]);\n\n if (status.isLoading || clerkStatus === 'sign_up') {\n // clerkStatus being sign_up will trigger a navigation to the sign up flow, so show a loading card instead of\n // rendering the sign in flow.\n return <LoadingCard />;\n }\n\n // @ts-expect-error `action` is not typed\n const { action, validLastAuthenticationStrategies, ...identifierFieldProps } = identifierField.props;\n\n const lastAuthenticationStrategy = clerk.client?.lastAuthenticationStrategy;\n const isIdentifierLastAuthenticationStrategy =\n lastAuthenticationStrategy && totalEnabledAuthMethods > 1\n ? validLastAuthenticationStrategies?.has(lastAuthenticationStrategy)\n : false;\n\n const blockedDetails = actionBlockedDetailsFrom(card.rawError);\n if (blockedDetails) {\n return <ActionBlockedCard details={blockedDetails} />;\n }\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.titleCombined')\n : localizationKeys('signIn.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.subtitleCombined')\n : localizationKeys('signIn.start.subtitle')\n }\n sx={{\n '&:empty': {\n display: 'none',\n },\n }}\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n {/*TODO: extract main in its own component */}\n <Col\n elementDescriptor={descriptors.main}\n gap={6}\n {...inertProps(captchaIsInteractive)}\n // `display:none` (not `visibility:hidden`) so the collapsed column leaves flex flow and\n // contributes no `gap` gutter to `Card.Content` — otherwise it injects empty space above\n // the spotlighted captcha. Subtree stays mounted (form state preserved); `inert` is then\n // redundant-but-harmless.\n sx={captchaIsInteractive ? { display: 'none' } : undefined}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {hasSocialOrWeb3Buttons && (\n <SignInSocialButtons\n enableWeb3Providers\n enableOAuthProviders\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n />\n )}\n {standardFormAttributes.length ? (\n <Form.Root\n onSubmit={handleFirstPartySubmit}\n gap={8}\n >\n <Col gap={6}>\n <Form.ControlRow elementId={identifierField.id}>\n <DynamicField\n actionLabel={nextIdentifier?.action}\n onActionClicked={switchToNextIdentifier}\n {...identifierFieldProps}\n autoFocus={shouldAutofocus}\n autoComplete={isWebAuthnAutofillSupported ? 'webauthn' : undefined}\n isLastAuthenticationStrategy={isIdentifierLastAuthenticationStrategy}\n />\n </Form.ControlRow>\n <InstantPasswordRow\n field={passwordBasedInstance ? instantPasswordField : undefined}\n onForgotPasswordClick={handleForgotPasswordClick}\n />\n </Col>\n <Col center>\n <Form.SubmitButton hasArrow />\n </Col>\n </Form.Root>\n ) : null}\n </SocialButtonsReversibleContainerWithDivider>\n </Col>\n <CaptchaElement\n gapless\n onInteractiveChange={setCaptchaIsInteractive}\n />\n {/* Kept outside descriptors.main so the spotlight's `inert` leaves this alternative action reachable. */}\n {userSettings.attributes.passkey?.enabled &&\n userSettings.passkeySettings.show_sign_in_button &&\n isWebSupported && (\n <Card.Action elementId={'usePasskey'}>\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__use_passkey')}\n onClick={() => authenticateWithPasskey({ flow: 'discoverable' })}\n />\n </Card.Action>\n )}\n </Card.Content>\n <Card.Footer>\n {userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC && !isCombinedFlow && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink')}\n to={clerk.buildUrlWithAuth(signUpUrl)}\n />\n </Card.Action>\n )}\n {userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText__join_waitlist')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__join_waitlist')}\n to={clerk.buildUrlWithAuth(waitlistUrl)}\n />\n </Card.Action>\n )}\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignInAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleFirstPartySubmit}\n phoneNumberFormState={phoneIdentifierField}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nconst InstantPasswordRow = ({\n field,\n onForgotPasswordClick,\n}: {\n field?: FormControlState<'password'>;\n onForgotPasswordClick?: React.MouseEventHandler;\n}) => {\n const [autofilled, setAutofilled] = useState(false);\n const ref = useRef<HTMLInputElement>(null);\n const show = !!(autofilled || field?.value);\n\n // show password if it's autofilled by the browser\n useLayoutEffect(() => {\n const intervalId = setInterval(() => {\n if (ref?.current) {\n const autofilled =\n window.getComputedStyle(ref.current, ':autofill').animationName === 'onAutoFillStart' ||\n // https://github.com/facebook/react/issues/1159#issuecomment-1025423604\n !!ref.current?.matches('*:-webkit-autofill');\n if (autofilled) {\n setAutofilled(autofilled);\n clearInterval(intervalId);\n }\n }\n }, 500);\n\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n useEffect(() => {\n //if the field receives a value, we default to normal behaviour\n if (field?.value && field.value !== '') {\n setAutofilled(false);\n }\n }, [field?.value]);\n\n if (!field) {\n return null;\n }\n\n return (\n <Form.ControlRow\n elementId={field.id}\n aria-hidden={show ? undefined : true}\n sx={\n show\n ? undefined\n : {\n position: 'absolute',\n opacity: 0,\n height: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n marginTop: '-1rem',\n }\n }\n >\n <Form.PasswordInput\n {...field.props}\n actionLabel={show ? localizationKeys('formFieldAction__forgotPassword') : undefined}\n onActionClicked={show ? onForgotPasswordClick : undefined}\n tabIndex={show ? undefined : -1}\n ref={ref}\n />\n </Form.ControlRow>\n );\n};\n\nexport const SignInStart = withRedirectToSignInTask(\n withRedirectToAfterSignIn(withCardStateProvider(SignInStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,2BAA2B;CAC/B,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,uBAAuB,SAAS,YAAY;CAClD,MAAM,0BAA0B,iCAAiC,gBAAgB,eAAe;CAChG,MAAM,EAAE,iBAAiB,eAAe;CACxC,MAAM,EAAE,iBAAiB,eAAe;CAExC,MAAM,EAAE,2CAA2C,SAAS;CAE5D,gBAAgB;EAC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GACvC,EACU;IAEJ,IACJ,OAEX,oBAAC,2CAAD;GACE,cAAc;GACd,sBAAsB;GACtB,oBAAoB;GACpB,mBAAmB;EACpB;CAEM;AAEf;AAEA,MAAM,sBAAsB,EAC1B,OACA,4BAII;CACJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,MAAM,OAAyB,IAAI;CACzC,MAAM,OAAO,CAAC,EAAE,cAAc,OAAO;CAGrC,sBAAsB;EACpB,MAAM,aAAa,kBAAkB;GACnC,IAAI,KAAK,SAAS;IAChB,MAAM,aACJ,OAAO,iBAAiB,IAAI,SAAS,WAAW,CAAC,CAAC,kBAAkB,qBAEpE,CAAC,CAAC,IAAI,SAAS,QAAQ,oBAAoB;IAC7C,IAAI,YAAY;KACd,cAAc,UAAU;KACxB,cAAc,UAAU;IAC1B;GACF;EACF,GAAG,GAAG;EAEN,aAAa;GACX,cAAc,UAAU;EAC1B;CACF,GAAG,CAAC,CAAC;CAEL,gBAAgB;EAEd,IAAI,OAAO,SAAS,MAAM,UAAU,IAClC,cAAc,KAAK;CAEvB,GAAG,CAAC,OAAO,KAAK,CAAC;CAEjB,IAAI,CAAC,OACH,OAAO;CAGT,OACE,oBAAC,KAAK,YAAN;EACE,WAAW,MAAM;EACjB,eAAa,OAAO,SAAY;EAChC,IACE,OACI,SACA;GACE,UAAU;GACV,SAAS;GACT,QAAQ;GACR,UAAU;GACV,eAAe;GACf,WAAW;EACb;YAGN,oBAAC,KAAK,eAAN;GACE,GAAI,MAAM;GACV,aAAa,OAAO,iBAAiB,iCAAiC,IAAI;GAC1E,iBAAiB,OAAO,wBAAwB;GAChD,UAAU,OAAO,SAAY;GACxB;EACN;CACc;AAErB;AAEA,MAAa,cAAc,yBACzB,0BAA0B,sBAAsB,mBAAmB,CAAC,CACtE"}
|
|
1
|
+
{"version":3,"file":"SignInStart.js","names":[],"sources":["../../../src/components/SignIn/SignInStart.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { inertProps } from '@clerk/shared/inert';\nimport { ERROR_CODES, SIGN_UP_MODES } from '@clerk/shared/internal/clerk-js/constants';\nimport { clerkInvalidFAPIResponse } from '@clerk/shared/internal/clerk-js/errors';\nimport { getClerkQueryParam, removeClerkQueryParam } from '@clerk/shared/internal/clerk-js/queryParams';\nimport { useClerk } from '@clerk/shared/react';\nimport type {\n ClerkAPIError,\n PhoneCodeChannel,\n PhoneCodeChannelData,\n SignInCreateParams,\n SignInResource,\n} from '@clerk/shared/types';\nimport { isWebAuthnAutofillSupported } from '@clerk/shared/webauthn';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState, withCardStateProvider } from '@/ui/elements/contexts';\nimport { Form } from '@/ui/elements/Form';\nimport { Header } from '@/ui/elements/Header';\nimport { LoadingCard } from '@/ui/elements/LoadingCard';\nimport { SocialButtonsReversibleContainerWithDivider } from '@/ui/elements/ReversibleContainer';\nimport { actionBlockedDetailsFrom } from '@/ui/utils/actionBlocked';\nimport { handleError } from '@/ui/utils/errorHandler';\nimport { isMobileDevice } from '@/ui/utils/isMobileDevice';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\nimport { buildRequest, useFormControl } from '@/ui/utils/useFormControl';\n\nimport type { SignInStartIdentifier } from '../../common';\nimport {\n ActionBlockedCard,\n getIdentifierControlDisplayValues,\n groupIdentifiers,\n withRedirectToAfterSignIn,\n withRedirectToSignInTask,\n} from '../../common';\nimport { useCoreSignIn, useEnvironment, useSignInContext } from '../../contexts';\nimport { Col, descriptors, Flow, localizationKeys } from '../../customizables';\nimport { CaptchaElement } from '../../elements/CaptchaElement';\nimport { useIsWebAuthnSupported, useLoadingStatus } from '../../hooks';\nimport { useSupportEmail } from '../../hooks/useSupportEmail';\nimport { useTotalEnabledAuthMethods } from '../../hooks/useTotalEnabledAuthMethods';\nimport { useRouter } from '../../router';\nimport {\n hasOnlyEnterpriseSSOFirstFactors,\n shouldHandOffToEnterpriseConnection,\n shouldHandOffUnidentifiedToEnterpriseConnection,\n} from './enterpriseSSOFactors';\nimport { handleCombinedFlowTransfer } from './handleCombinedFlowTransfer';\nimport { isProtectCheckRequiredError, navigateOnSignInProtectGate } from './handleProtectCheck';\nimport { SIGN_IN_RESET_PASSWORD_INTENT_PARAM, useHandleAuthenticateWithPasskey } from './shared';\nimport { SignInAlternativePhoneCodePhoneNumberCard } from './SignInAlternativePhoneCodePhoneNumberCard';\nimport { SignInSocialButtons } from './SignInSocialButtons';\nimport {\n getPreferredAlternativePhoneChannel,\n getPreferredAlternativePhoneChannelForCombinedFlow,\n getSignUpAttributeFromIdentifier,\n} from './utils';\n\nconst useAutoFillPasskey = () => {\n const [isSupported, setIsSupported] = useState(false);\n const { navigate } = useRouter();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor, 'protect-check');\n const { userSettings } = useEnvironment();\n const { passkeySettings, attributes } = userSettings;\n // @ts-expect-error - This is not a public API\n const { __internal_isWebAuthnAutofillSupported } = useClerk();\n\n useEffect(() => {\n async function runAutofillPasskey() {\n const _isSupported = await (__internal_isWebAuthnAutofillSupported ?? isWebAuthnAutofillSupported)();\n setIsSupported(_isSupported);\n if (!_isSupported) {\n return;\n }\n\n await authenticateWithPasskey({ flow: 'autofill' });\n }\n\n if (passkeySettings.allow_autofill && attributes.passkey?.enabled) {\n runAutofillPasskey();\n }\n }, []);\n\n return {\n isWebAuthnAutofillSupported: isSupported,\n };\n};\n\nfunction SignInStartInternal(): JSX.Element {\n const card = useCardState();\n const clerk = useClerk();\n const status = useLoadingStatus();\n const { userSettings, authConfig } = useEnvironment();\n const signIn = useCoreSignIn();\n const { navigate } = useRouter();\n const ctx = useSignInContext();\n const { afterSignInUrl, signUpUrl, waitlistUrl, isCombinedFlow, signUpIfMissingEnabled, navigateOnSetActive } = ctx;\n const supportEmail = useSupportEmail();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const identifierAttributes = useMemo<SignInStartIdentifier[]>(\n () => groupIdentifiers(userSettings.enabledFirstFactorIdentifiers),\n [userSettings.enabledFirstFactorIdentifiers],\n );\n const alternativePhoneCodeChannels = userSettings.alternativePhoneCodeChannels;\n\n /**\n * Passkeys\n */\n const { isWebAuthnAutofillSupported } = useAutoFillPasskey();\n const onSecondFactor = () => navigate('factor-two');\n const authenticateWithPasskey = useHandleAuthenticateWithPasskey(onSecondFactor, 'protect-check');\n const isWebSupported = useIsWebAuthnSupported();\n\n const onlyPhoneNumberInitialValueExists =\n !!ctx.initialValues?.phoneNumber && !(ctx.initialValues.emailAddress || ctx.initialValues.username);\n const shouldStartWithPhoneNumberIdentifier =\n onlyPhoneNumberInitialValueExists && identifierAttributes.includes('phone_number');\n const [identifierAttribute, setIdentifierAttribute] = useState<SignInStartIdentifier>(\n shouldStartWithPhoneNumberIdentifier ? 'phone_number' : identifierAttributes[0] || '',\n );\n const [hasSwitchedByAutofill, setHasSwitchedByAutofill] = useState(false);\n\n const organizationTicket = getClerkQueryParam('__clerk_ticket') || '';\n const clerkStatus = getClerkQueryParam('__clerk_status') || '';\n\n const standardFormAttributes = userSettings.enabledFirstFactorIdentifiers;\n const web3FirstFactors = userSettings.web3FirstFactors;\n const authenticatableSocialStrategies = userSettings.authenticatableSocialStrategies;\n const passwordBasedInstance = userSettings.instanceIsPasswordBased;\n const { currentIdentifier, nextIdentifier } = getIdentifierControlDisplayValues(\n identifierAttributes,\n identifierAttribute,\n );\n const instantPasswordField = useFormControl('password', '', {\n type: 'password',\n label: localizationKeys('formFieldLabel__password'),\n placeholder: localizationKeys('formFieldInputPlaceholder__password') as any,\n });\n\n const [alternativePhoneCodeProvider, setAlternativePhoneCodeProvider] = useState<PhoneCodeChannelData | null>(null);\n\n const showAlternativePhoneCodeProviders = userSettings.alternativePhoneCodeChannels.length > 0;\n\n const onAlternativePhoneCodeUseAnotherMethod = () => {\n setAlternativePhoneCodeProvider(null);\n };\n const onAlternativePhoneCodeProviderClick = (phoneCodeChannel: PhoneCodeChannel) => {\n const provider: PhoneCodeChannelData | null = getAlternativePhoneCodeProviderData(phoneCodeChannel) || null;\n setAlternativePhoneCodeProvider(provider);\n };\n\n const ctxInitialValues = ctx.initialValues || {};\n const initialValues: Record<SignInStartIdentifier, string | undefined> = useMemo(\n () => ({\n email_address: ctxInitialValues.emailAddress,\n email_address_username: ctxInitialValues.emailAddress || ctxInitialValues.username,\n username: ctxInitialValues.username,\n phone_number: ctxInitialValues.phoneNumber,\n }),\n [ctx.initialValues],\n );\n\n const hasSocialOrWeb3Buttons =\n !!authenticatableSocialStrategies.length || !!web3FirstFactors.length || !!alternativePhoneCodeChannels.length;\n const [shouldAutofocus, setShouldAutofocus] = useState(!isMobileDevice() && !hasSocialOrWeb3Buttons);\n // When the captcha escalates to an interactive challenge, spotlight it by collapsing/inerting the\n // rest of the card (see the descriptors.main column below).\n const [captchaIsInteractive, setCaptchaIsInteractive] = useState(false);\n const textIdentifierField = useFormControl('identifier', initialValues[identifierAttribute] || '', {\n ...currentIdentifier,\n isRequired: true,\n transformer: value => value.trim(),\n });\n\n const phoneIdentifierField = useFormControl('identifier', initialValues['phone_number'] || '', {\n ...currentIdentifier,\n isRequired: true,\n });\n\n const identifierField = identifierAttribute === 'phone_number' ? phoneIdentifierField : textIdentifierField;\n\n const switchToNextIdentifier = () => {\n setIdentifierAttribute(\n i => identifierAttributes[(identifierAttributes.indexOf(i) + 1) % identifierAttributes.length],\n );\n setShouldAutofocus(true);\n setHasSwitchedByAutofill(false);\n };\n\n const handlePhoneNumberPaste = (value: string) => {\n textIdentifierField.setValue(initialValues[identifierAttribute] || '');\n phoneIdentifierField.setValue(value);\n setIdentifierAttribute('phone_number');\n setShouldAutofocus(true);\n };\n\n // switch to the phone input (if available) if a \"+\" is entered\n // (either by the browser or the user)\n // this does not work in chrome as it does not fire the change event and the value is\n // not available via js\n useLayoutEffect(() => {\n if (\n identifierField.value.startsWith('+') &&\n identifierAttributes.includes('phone_number') &&\n identifierAttribute !== 'phone_number' &&\n !hasSwitchedByAutofill\n ) {\n handlePhoneNumberPaste(identifierField.value);\n // do not switch automatically on subsequent autofills\n // by the browser to avoid a switch loop\n setHasSwitchedByAutofill(true);\n }\n }, [identifierField.value, identifierAttributes]);\n\n useEffect(() => {\n if (!organizationTicket) {\n return;\n }\n\n if (clerkStatus === 'sign_up') {\n const paramsToForward = new URLSearchParams();\n if (organizationTicket) {\n paramsToForward.set('__clerk_ticket', organizationTicket);\n }\n // We explicitly navigate to 'create' in the combined flow to trigger a client-side navigation. Navigating to\n // signUpUrl triggers a full page reload when used with the hash router.\n void navigate(isCombinedFlow ? `create` : signUpUrl, { searchParams: paramsToForward });\n return;\n }\n\n status.setLoading();\n card.setLoading();\n signIn\n .create({\n strategy: 'ticket',\n ticket: organizationTicket,\n })\n .then(res => {\n if (navigateOnSignInProtectGate(res, navigate, 'protect-check')) {\n return;\n }\n switch (res.status) {\n case 'needs_first_factor': {\n if (!shouldHandOffToEnterpriseConnection(res)) {\n return navigate('factor-one');\n }\n\n return authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n removeClerkQueryParam('__clerk_ticket');\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n })\n .catch(err => {\n return attemptToRecoverFromSignInError(err);\n })\n .finally(() => {\n // Keep the card in loading state during SSO redirect to prevent UI flicker\n // This is necessary because there's a brief delay between initiating the SSO flow\n // and the actual redirect to the external Identity Provider\n const isRedirectingToSSOProvider = !!hasOnlyEnterpriseSSOFirstFactors(signIn);\n if (isRedirectingToSSOProvider) {\n return;\n }\n\n status.setIdle();\n card.setIdle();\n });\n }, []);\n\n useEffect(() => {\n async function handleOauthError() {\n const defaultErrorHandler = () => {\n // Error from server may be too much information for the end user, so set a generic error\n card.setError('Unable to complete action at this time. If the problem persists please contact support.');\n };\n\n const error = signIn?.firstFactorVerification?.error;\n if (error) {\n switch (error.code) {\n case ERROR_CODES.NOT_ALLOWED_TO_SIGN_UP:\n case ERROR_CODES.OAUTH_ACCESS_DENIED:\n case ERROR_CODES.NOT_ALLOWED_ACCESS:\n case ERROR_CODES.SAML_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:\n case ERROR_CODES.USER_LOCKED:\n case ERROR_CODES.EXTERNAL_ACCOUNT_NOT_FOUND:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED:\n case ERROR_CODES.SIGN_UP_MODE_RESTRICTED_WAITLIST:\n case ERROR_CODES.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:\n case ERROR_CODES.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:\n case ERROR_CODES.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:\n case ERROR_CODES.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:\n case ERROR_CODES.CAPTCHA_INVALID:\n case ERROR_CODES.FRAUD_DEVICE_BLOCKED:\n case ERROR_CODES.FRAUD_ACTION_BLOCKED:\n case ERROR_CODES.SIGNUP_RATE_LIMIT_EXCEEDED:\n case ERROR_CODES.USER_BANNED:\n case ERROR_CODES.USER_DEACTIVATED:\n card.setError(error);\n break;\n default:\n defaultErrorHandler();\n }\n\n // TODO: This is a workaround in order to reset the sign in attempt\n // so that the oauth error does not persist on full page reloads.\n void (await signIn.create({}));\n }\n }\n\n void handleOauthError();\n }, []);\n\n const buildSignInParams = (fields: Array<FormControlState<string>>): SignInCreateParams => {\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n\n /**\n * FAPI will return an error when password is submitted but the user's email matches requires enterprise sso authentication.\n * We need to strip password from the create request, and reconstruct it later.\n */\n if (!hasPassword || userSettings.enterpriseSSO.enabled) {\n fields = fields.filter(f => f.name !== 'password');\n }\n return {\n ...buildRequest(fields),\n ...(hasPassword && !userSettings.enterpriseSSO.enabled && { strategy: 'password' }),\n } as SignInCreateParams;\n };\n\n const safePasswordSignInForEnterpriseSSOInstance = (\n signInCreatePromise: Promise<SignInResource>,\n fields: Array<FormControlState<string>>,\n ) => {\n return signInCreatePromise.then(signInResource => {\n if (!userSettings.enterpriseSSO.enabled) {\n return signInResource;\n }\n /**\n * For instances with Enterprise SSO enabled, perform sign in with password only when it is allowed for the identified user.\n */\n const passwordField = fields.find(f => f.name === 'password')?.value;\n if (!passwordField || signInResource.supportedFirstFactors?.some(ff => ff.strategy === 'enterprise_sso')) {\n return signInResource;\n }\n return signInResource.attemptFirstFactor({ strategy: 'password', password: passwordField });\n });\n };\n\n const signInWithFields = async (\n fields: Array<FormControlState<string>>,\n options?: { resetPasswordIntent?: boolean },\n ) => {\n // If the user has already selected an alternative phone code provider, we use that.\n const preferredAlternativePhoneChannel =\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannel(fields, authConfig.preferredChannels, 'identifier');\n if (preferredAlternativePhoneChannel) {\n // We need to send the alternative phone code provider channel in the sign in request\n // together with the phone_code strategy, in order for FAPI to create a Verification upon this first request.\n const noop = () => {};\n fields.push({\n id: 'strategy',\n value: 'phone_code',\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n fields.push({\n id: 'channel',\n value: preferredAlternativePhoneChannel,\n clearFeedback: noop,\n setValue: noop,\n onChange: noop,\n setError: noop,\n } as any);\n }\n try {\n // On top of the context-level preconditions, sign-up-if-missing only\n // supports identifiers that can be verified out-of-band.\n const hasPassword = fields.some(f => f.name === 'password' && !!f.value);\n const signUpAttribute = getSignUpAttributeFromIdentifier(identifierField);\n const shouldSignUpIfMissing = signUpIfMissingEnabled && signUpAttribute !== 'username' && !hasPassword;\n\n const res = await safePasswordSignInForEnterpriseSSOInstance(\n signIn.create({\n ...buildSignInParams(fields),\n ...(shouldSignUpIfMissing && { signUpIfMissing: true }),\n }),\n fields,\n );\n\n if (navigateOnSignInProtectGate(res, navigate, 'protect-check')) {\n return;\n }\n\n switch (res.status) {\n case 'needs_identifier':\n // Check if we need to initiate an enterprise sso flow\n if (shouldHandOffUnidentifiedToEnterpriseConnection(res)) {\n await authenticateWithEnterpriseSSO();\n }\n break;\n case 'needs_first_factor': {\n if (!shouldHandOffToEnterpriseConnection(res)) {\n if (options?.resetPasswordIntent) {\n return navigate('factor-one', {\n searchParams: new URLSearchParams({ [SIGN_IN_RESET_PASSWORD_INTENT_PARAM]: 'true' }),\n });\n }\n return navigate('factor-one');\n }\n\n // Awaited so a failed hand-off reaches the catch below instead of escaping this try.\n return await authenticateWithEnterpriseSSO();\n }\n case 'needs_second_factor':\n return navigate('factor-two');\n case 'needs_client_trust':\n return navigate('client-trust');\n case 'complete':\n return clerk.setActive({\n session: res.createdSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n default: {\n console.error(clerkInvalidFAPIResponse(res.status, supportEmail));\n return;\n }\n }\n } catch (e: any) {\n return attemptToRecoverFromSignInError(e);\n }\n };\n\n const authenticateWithEnterpriseSSO = async () => {\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignInUrl || '/';\n\n try {\n await signIn.authenticateWithRedirect({\n strategy: 'enterprise_sso',\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n continueSignIn: true,\n });\n } catch (err) {\n // Preparing the hand-off can itself raise a challenge. No redirect was issued and the sign-in\n // is sitting on the gate instead. Handled here because the callers' recovery path drops\n // errors that didn't come from the API.\n if (isProtectCheckRequiredError(err) && navigateOnSignInProtectGate(signIn, navigate, 'protect-check')) {\n return;\n }\n throw err;\n }\n };\n\n const attemptToRecoverFromSignInError = async (e: any) => {\n if (!e.errors) {\n return;\n }\n const instantPasswordError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVALID_STRATEGY_FOR_USER ||\n e.code === ERROR_CODES.FORM_PASSWORD_INCORRECT ||\n e.code === ERROR_CODES.FORM_PASSWORD_PWNED,\n );\n\n const sessionAlreadyExistsError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === ERROR_CODES.SESSION_EXISTS,\n );\n const alreadySignedInError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) => e.code === 'identifier_already_signed_in',\n );\n const accountDoesNotExistError: ClerkAPIError = e.errors.find(\n (e: ClerkAPIError) =>\n e.code === ERROR_CODES.INVITATION_ACCOUNT_NOT_EXISTS || e.code === ERROR_CODES.FORM_IDENTIFIER_NOT_FOUND,\n );\n\n if (instantPasswordError) {\n await signInWithFields([identifierField]);\n } else if (sessionAlreadyExistsError) {\n await clerk.setActive({\n session: clerk.client.lastActiveSessionId,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (alreadySignedInError) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sid = alreadySignedInError.meta!.sessionId!;\n await clerk.setActive({\n session: sid,\n navigate: async ({ session, decorateUrl }) => {\n await navigateOnSetActive({ session, redirectUrl: afterSignInUrl, decorateUrl });\n },\n });\n } else if (isCombinedFlow && accountDoesNotExistError) {\n const attribute = getSignUpAttributeFromIdentifier(identifierField);\n\n if (userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST) {\n const waitlistUrl = clerk.buildWaitlistUrl(\n attribute === 'emailAddress'\n ? {\n initialValues: {\n [attribute]: identifierField.value,\n },\n }\n : {},\n );\n return navigate(waitlistUrl);\n }\n\n clerk.client.signUp[attribute] = identifierField.value;\n\n const redirectUrl = ctx.ssoCallbackUrl;\n const redirectUrlComplete = ctx.afterSignUpUrl || '/';\n\n return handleCombinedFlowTransfer({\n afterSignUpUrl: ctx.afterSignUpUrl || '/',\n clerk,\n handleError: e => handleError(e, [identifierField, instantPasswordField], card.setError),\n identifierAttribute: attribute,\n identifierValue: identifierField.value,\n navigate,\n organizationTicket,\n signUpMode: userSettings.signUp.mode,\n redirectUrl,\n redirectUrlComplete,\n oidcPrompt: ctx.oidcPrompt,\n navigateOnSetActive,\n passwordEnabled: userSettings.attributes.password?.required ?? false,\n alternativePhoneCodeChannel:\n alternativePhoneCodeProvider?.channel ||\n getPreferredAlternativePhoneChannelForCombinedFlow(\n authConfig.preferredChannels,\n attribute,\n identifierField.value,\n ),\n unsafeMetadata: ctx.unsafeMetadata,\n });\n } else {\n handleError(e, [identifierField, instantPasswordField], card.setError);\n }\n };\n\n const handleFirstPartySubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n return signInWithFields([identifierField, instantPasswordField]);\n };\n\n const handleForgotPasswordClick: React.MouseEventHandler = e => {\n e.preventDefault();\n // Surface the same native required-field validation as the Continue button\n // when the identifier is missing\n const form = e.currentTarget.closest('form');\n if (form && !form.reportValidity()) {\n return;\n }\n void signInWithFields([identifierField], { resetPasswordIntent: true });\n };\n\n const DynamicField = useMemo(() => {\n const components = {\n tel: Form.PhoneInput,\n password: Form.PasswordInput,\n text: Form.PlainInput,\n email: Form.PlainInput,\n };\n\n return components[identifierField.type as keyof typeof components];\n }, [identifierField.type]);\n\n if (status.isLoading || clerkStatus === 'sign_up') {\n // clerkStatus being sign_up will trigger a navigation to the sign up flow, so show a loading card instead of\n // rendering the sign in flow.\n return <LoadingCard />;\n }\n\n // @ts-expect-error `action` is not typed\n const { action, validLastAuthenticationStrategies, ...identifierFieldProps } = identifierField.props;\n\n const lastAuthenticationStrategy = clerk.client?.lastAuthenticationStrategy;\n const isIdentifierLastAuthenticationStrategy =\n lastAuthenticationStrategy && totalEnabledAuthMethods > 1\n ? validLastAuthenticationStrategies?.has(lastAuthenticationStrategy)\n : false;\n\n const blockedDetails = actionBlockedDetailsFrom(card.rawError);\n if (blockedDetails) {\n return <ActionBlockedCard details={blockedDetails} />;\n }\n\n return (\n <Flow.Part part='start'>\n {!alternativePhoneCodeProvider ? (\n <Card.Root>\n <Card.Content>\n <Header.Root showLogo>\n <Header.Title\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.titleCombined')\n : localizationKeys('signIn.start.title')\n }\n />\n <Header.Subtitle\n localizationKey={\n isCombinedFlow\n ? localizationKeys('signIn.start.subtitleCombined')\n : localizationKeys('signIn.start.subtitle')\n }\n sx={{\n '&:empty': {\n display: 'none',\n },\n }}\n />\n </Header.Root>\n <Card.Alert>{card.error}</Card.Alert>\n {/*TODO: extract main in its own component */}\n <Col\n elementDescriptor={descriptors.main}\n gap={6}\n {...inertProps(captchaIsInteractive)}\n // `display:none` (not `visibility:hidden`) so the collapsed column leaves flex flow and\n // contributes no `gap` gutter to `Card.Content` — otherwise it injects empty space above\n // the spotlighted captcha. Subtree stays mounted (form state preserved); `inert` is then\n // redundant-but-harmless.\n sx={captchaIsInteractive ? { display: 'none' } : undefined}\n >\n <SocialButtonsReversibleContainerWithDivider>\n {hasSocialOrWeb3Buttons && (\n <SignInSocialButtons\n enableWeb3Providers\n enableOAuthProviders\n enableAlternativePhoneCodeProviders={showAlternativePhoneCodeProviders}\n onAlternativePhoneCodeProviderClick={onAlternativePhoneCodeProviderClick}\n />\n )}\n {standardFormAttributes.length ? (\n <Form.Root\n onSubmit={handleFirstPartySubmit}\n gap={8}\n >\n <Col gap={6}>\n <Form.ControlRow elementId={identifierField.id}>\n <DynamicField\n actionLabel={nextIdentifier?.action}\n onActionClicked={switchToNextIdentifier}\n {...identifierFieldProps}\n autoFocus={shouldAutofocus}\n autoComplete={\n isWebAuthnAutofillSupported\n ? `${currentIdentifier.autoComplete} webauthn`\n : currentIdentifier.autoComplete\n }\n isLastAuthenticationStrategy={isIdentifierLastAuthenticationStrategy}\n />\n </Form.ControlRow>\n <InstantPasswordRow\n field={passwordBasedInstance ? instantPasswordField : undefined}\n onForgotPasswordClick={handleForgotPasswordClick}\n />\n </Col>\n <Col center>\n <Form.SubmitButton hasArrow />\n </Col>\n </Form.Root>\n ) : null}\n </SocialButtonsReversibleContainerWithDivider>\n </Col>\n <CaptchaElement\n gapless\n onInteractiveChange={setCaptchaIsInteractive}\n />\n {/* Kept outside descriptors.main so the spotlight's `inert` leaves this alternative action reachable. */}\n {userSettings.attributes.passkey?.enabled &&\n userSettings.passkeySettings.show_sign_in_button &&\n isWebSupported && (\n <Card.Action elementId={'usePasskey'}>\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__use_passkey')}\n onClick={() => authenticateWithPasskey({ flow: 'discoverable' })}\n />\n </Card.Action>\n )}\n </Card.Content>\n <Card.Footer>\n {userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC && !isCombinedFlow && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink')}\n to={clerk.buildUrlWithAuth(signUpUrl)}\n />\n </Card.Action>\n )}\n {userSettings.signUp.mode === SIGN_UP_MODES.WAITLIST && (\n <Card.Action elementId='signIn'>\n <Card.ActionText localizationKey={localizationKeys('signIn.start.actionText__join_waitlist')} />\n <Card.ActionLink\n localizationKey={localizationKeys('signIn.start.actionLink__join_waitlist')}\n to={clerk.buildUrlWithAuth(waitlistUrl)}\n />\n </Card.Action>\n )}\n </Card.Footer>\n </Card.Root>\n ) : (\n <SignInAlternativePhoneCodePhoneNumberCard\n handleSubmit={handleFirstPartySubmit}\n phoneNumberFormState={phoneIdentifierField}\n onUseAnotherMethod={onAlternativePhoneCodeUseAnotherMethod}\n phoneCodeProvider={alternativePhoneCodeProvider}\n />\n )}\n </Flow.Part>\n );\n}\n\nconst InstantPasswordRow = ({\n field,\n onForgotPasswordClick,\n}: {\n field?: FormControlState<'password'>;\n onForgotPasswordClick?: React.MouseEventHandler;\n}) => {\n const [autofilled, setAutofilled] = useState(false);\n const ref = useRef<HTMLInputElement>(null);\n const show = !!(autofilled || field?.value);\n\n // show password if it's autofilled by the browser\n useLayoutEffect(() => {\n const intervalId = setInterval(() => {\n if (ref?.current) {\n const autofilled =\n window.getComputedStyle(ref.current, ':autofill').animationName === 'onAutoFillStart' ||\n // https://github.com/facebook/react/issues/1159#issuecomment-1025423604\n !!ref.current?.matches('*:-webkit-autofill');\n if (autofilled) {\n setAutofilled(autofilled);\n clearInterval(intervalId);\n }\n }\n }, 500);\n\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n useEffect(() => {\n //if the field receives a value, we default to normal behaviour\n if (field?.value && field.value !== '') {\n setAutofilled(false);\n }\n }, [field?.value]);\n\n if (!field) {\n return null;\n }\n\n return (\n <Form.ControlRow\n elementId={field.id}\n aria-hidden={show ? undefined : true}\n sx={\n show\n ? undefined\n : {\n position: 'absolute',\n opacity: 0,\n height: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n marginTop: '-1rem',\n }\n }\n >\n <Form.PasswordInput\n {...field.props}\n actionLabel={show ? localizationKeys('formFieldAction__forgotPassword') : undefined}\n onActionClicked={show ? onForgotPasswordClick : undefined}\n tabIndex={show ? undefined : -1}\n ref={ref}\n />\n </Form.ControlRow>\n );\n};\n\nexport const SignInStart = withRedirectToSignInTask(\n withRedirectToAfterSignIn(withCardStateProvider(SignInStartInternal)),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,2BAA2B;CAC/B,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,aAAa,UAAU;CAC/B,MAAM,uBAAuB,SAAS,YAAY;CAClD,MAAM,0BAA0B,iCAAiC,gBAAgB,eAAe;CAChG,MAAM,EAAE,iBAAiB,eAAe;CACxC,MAAM,EAAE,iBAAiB,eAAe;CAExC,MA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
|
27
27
|
children: [shouldShow("firstName") && /* @__PURE__ */ jsx(Form.PlainInput, {
|
|
28
28
|
...formState.firstName.props,
|
|
29
29
|
isRequired: fields.firstName?.required,
|
|
30
|
-
isOptional: !fields.firstName?.required
|
|
30
|
+
isOptional: !fields.firstName?.required,
|
|
31
|
+
autoComplete: "given-name"
|
|
31
32
|
}), shouldShow("lastName") && /* @__PURE__ */ jsx(Form.PlainInput, {
|
|
32
33
|
...formState.lastName.props,
|
|
33
34
|
isRequired: fields.lastName?.required,
|
|
34
|
-
isOptional: !fields.lastName?.required
|
|
35
|
+
isOptional: !fields.lastName?.required,
|
|
36
|
+
autoComplete: "family-name"
|
|
35
37
|
})]
|
|
36
38
|
}),
|
|
37
39
|
shouldShow("username") && /* @__PURE__ */ jsx(Form.ControlRow, {
|
|
@@ -39,7 +41,8 @@ const SignUpForm = (props) => {
|
|
|
39
41
|
children: /* @__PURE__ */ jsx(Form.PlainInput, {
|
|
40
42
|
...formState.username.props,
|
|
41
43
|
isRequired: fields.username?.required,
|
|
42
|
-
isOptional: !fields.username?.required
|
|
44
|
+
isOptional: !fields.username?.required,
|
|
45
|
+
autoComplete: "username"
|
|
43
46
|
})
|
|
44
47
|
}),
|
|
45
48
|
shouldShow("emailAddress") && /* @__PURE__ */ jsx(Form.ControlRow, {
|
|
@@ -49,6 +52,7 @@ const SignUpForm = (props) => {
|
|
|
49
52
|
isRequired: fields.emailAddress?.required,
|
|
50
53
|
isOptional: !fields.emailAddress?.required,
|
|
51
54
|
isDisabled: fields.emailAddress?.disabled,
|
|
55
|
+
autoComplete: "email",
|
|
52
56
|
actionLabel: canToggleEmailPhone ? localizationKeys("signUp.start.actionLink__use_phone") : void 0,
|
|
53
57
|
onActionClicked: canToggleEmailPhone ? () => handleEmailPhoneToggle("phoneNumber") : void 0
|
|
54
58
|
})
|
|
@@ -59,6 +63,7 @@ const SignUpForm = (props) => {
|
|
|
59
63
|
...formState.phoneNumber.props,
|
|
60
64
|
isRequired: fields.phoneNumber?.required,
|
|
61
65
|
isOptional: !fields.phoneNumber?.required,
|
|
66
|
+
autoComplete: "tel",
|
|
62
67
|
actionLabel: canToggleEmailPhone ? localizationKeys("signUp.start.actionLink__use_email") : void 0,
|
|
63
68
|
onActionClicked: canToggleEmailPhone ? () => handleEmailPhoneToggle("emailAddress") : void 0
|
|
64
69
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpForm.js","names":[],"sources":["../../../src/components/SignUp/SignUpForm.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Form } from '@/ui/elements/Form';\nimport { LegalCheckbox } from '@/ui/elements/LegalConsentCheckbox';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\n\nimport { Col, localizationKeys, useAppearance } from '../../customizables';\nimport { mqu } from '../../styledSystem';\nimport type { ActiveIdentifier, Fields } from './signUpFormHelpers';\n\ntype SignUpFormProps = {\n handleSubmit: React.FormEventHandler;\n fields: Fields;\n formState: Record<Exclude<keyof Fields, 'ticket'>, FormControlState<any>>;\n canToggleEmailPhone: boolean;\n handleEmailPhoneToggle: (type: ActiveIdentifier) => void;\n onlyLegalAcceptedMissing?: boolean;\n};\n\nexport const SignUpForm = (props: SignUpFormProps) => {\n const {\n handleSubmit,\n fields,\n formState,\n canToggleEmailPhone,\n onlyLegalAcceptedMissing = false,\n handleEmailPhoneToggle,\n } = props;\n const { showOptionalFields } = useAppearance().parsedOptions;\n\n const shouldShow = (name: keyof typeof fields) => {\n // In case both email & phone are optional, then don't take into account the\n // Options showOptionalFields prop and the required field.\n if ((name === 'emailAddress' || name === 'phoneNumber') && canToggleEmailPhone) {\n return !!fields[name];\n }\n\n return !!fields[name] && (showOptionalFields || fields[name]?.required);\n };\n\n return (\n <Form.Root\n onSubmit={handleSubmit}\n gap={8}\n >\n {!onlyLegalAcceptedMissing && (\n <Col gap={6}>\n {(shouldShow('firstName') || shouldShow('lastName')) && (\n <Form.ControlRow\n elementId='name'\n sx={{\n [mqu.sm]: {\n flexWrap: 'wrap',\n },\n }}\n >\n {shouldShow('firstName') && (\n <Form.PlainInput\n {...formState.firstName.props}\n isRequired={fields.firstName?.required}\n isOptional={!fields.firstName?.required}\n />\n )}\n {shouldShow('lastName') && (\n <Form.PlainInput\n {...formState.lastName.props}\n isRequired={fields.lastName?.required}\n isOptional={!fields.lastName?.required}\n />\n )}\n </Form.ControlRow>\n )}\n {shouldShow('username') && (\n <Form.ControlRow elementId='username'>\n <Form.PlainInput\n {...formState.username.props}\n isRequired={fields.username?.required}\n isOptional={!fields.username?.required}\n />\n </Form.ControlRow>\n )}\n {shouldShow('emailAddress') && (\n <Form.ControlRow elementId='emailAddress'>\n <Form.PlainInput\n {...formState.emailAddress.props}\n isRequired={fields.emailAddress?.required}\n isOptional={!fields.emailAddress?.required}\n isDisabled={fields.emailAddress?.disabled}\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_phone') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('phoneNumber') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('phoneNumber') && (\n <Form.ControlRow elementId='phoneNumber'>\n <Form.PhoneInput\n {...formState.phoneNumber.props}\n isRequired={fields.phoneNumber?.required}\n isOptional={!fields.phoneNumber?.required}\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_email') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('emailAddress') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('password') && (\n <Form.ControlRow elementId='password'>\n <Form.PasswordInput\n {...formState.password.props}\n isRequired={fields.password?.required}\n isOptional={!fields.password?.required}\n autoComplete='new-password'\n />\n </Form.ControlRow>\n )}\n </Col>\n )}\n <Col center>\n <Col\n gap={6}\n sx={{\n width: '100%',\n }}\n >\n {shouldShow('legalAccepted') && (\n <Form.ControlRow elementId='legalAccepted'>\n <LegalCheckbox\n {...formState.legalAccepted.props}\n isRequired={fields.legalAccepted?.required}\n />\n </Form.ControlRow>\n )}\n <Form.SubmitButton\n hasArrow\n localizationKey={localizationKeys('formButtonPrimary')}\n />\n </Col>\n </Col>\n </Form.Root>\n );\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,cAAc,UAA2B;CACpD,MAAM,EACJ,cACA,QACA,WACA,qBACA,2BAA2B,OAC3B,2BACE;CACJ,MAAM,EAAE,uBAAuB,cAAc,CAAC,CAAC;CAE/C,MAAM,cAAc,SAA8B;EAGhD,KAAK,SAAS,kBAAkB,SAAS,kBAAkB,qBACzD,OAAO,CAAC,CAAC,OAAO;EAGlB,OAAO,CAAC,CAAC,OAAO,UAAU,sBAAsB,OAAO,KAAK,EAAE;CAChE;CAEA,OACE,qBAAC,KAAK,MAAN;EACE,UAAU;EACV,KAAK;YAFP,CAIG,CAAC,4BACA,qBAAC,KAAD;GAAK,KAAK;aAAV;KACI,WAAW,WAAW,KAAK,WAAW,UAAU,MAChD,qBAAC,KAAK,YAAN;KACE,WAAU;KACV,IAAI,GACD,IAAI,KAAK,EACR,UAAU,OACZ,EACF;eANF,CAQG,WAAW,WAAW,KACrB,oBAAC,KAAK,YAAN;MACE,GAAI,UAAU,UAAU;MACxB,YAAY,OAAO,WAAW;MAC9B,YAAY,CAAC,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"SignUpForm.js","names":[],"sources":["../../../src/components/SignUp/SignUpForm.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Form } from '@/ui/elements/Form';\nimport { LegalCheckbox } from '@/ui/elements/LegalConsentCheckbox';\nimport type { FormControlState } from '@/ui/utils/useFormControl';\n\nimport { Col, localizationKeys, useAppearance } from '../../customizables';\nimport { mqu } from '../../styledSystem';\nimport type { ActiveIdentifier, Fields } from './signUpFormHelpers';\n\ntype SignUpFormProps = {\n handleSubmit: React.FormEventHandler;\n fields: Fields;\n formState: Record<Exclude<keyof Fields, 'ticket'>, FormControlState<any>>;\n canToggleEmailPhone: boolean;\n handleEmailPhoneToggle: (type: ActiveIdentifier) => void;\n onlyLegalAcceptedMissing?: boolean;\n};\n\nexport const SignUpForm = (props: SignUpFormProps) => {\n const {\n handleSubmit,\n fields,\n formState,\n canToggleEmailPhone,\n onlyLegalAcceptedMissing = false,\n handleEmailPhoneToggle,\n } = props;\n const { showOptionalFields } = useAppearance().parsedOptions;\n\n const shouldShow = (name: keyof typeof fields) => {\n // In case both email & phone are optional, then don't take into account the\n // Options showOptionalFields prop and the required field.\n if ((name === 'emailAddress' || name === 'phoneNumber') && canToggleEmailPhone) {\n return !!fields[name];\n }\n\n return !!fields[name] && (showOptionalFields || fields[name]?.required);\n };\n\n return (\n <Form.Root\n onSubmit={handleSubmit}\n gap={8}\n >\n {!onlyLegalAcceptedMissing && (\n <Col gap={6}>\n {(shouldShow('firstName') || shouldShow('lastName')) && (\n <Form.ControlRow\n elementId='name'\n sx={{\n [mqu.sm]: {\n flexWrap: 'wrap',\n },\n }}\n >\n {shouldShow('firstName') && (\n <Form.PlainInput\n {...formState.firstName.props}\n isRequired={fields.firstName?.required}\n isOptional={!fields.firstName?.required}\n autoComplete='given-name'\n />\n )}\n {shouldShow('lastName') && (\n <Form.PlainInput\n {...formState.lastName.props}\n isRequired={fields.lastName?.required}\n isOptional={!fields.lastName?.required}\n autoComplete='family-name'\n />\n )}\n </Form.ControlRow>\n )}\n {shouldShow('username') && (\n <Form.ControlRow elementId='username'>\n <Form.PlainInput\n {...formState.username.props}\n isRequired={fields.username?.required}\n isOptional={!fields.username?.required}\n autoComplete='username'\n />\n </Form.ControlRow>\n )}\n {shouldShow('emailAddress') && (\n <Form.ControlRow elementId='emailAddress'>\n <Form.PlainInput\n {...formState.emailAddress.props}\n isRequired={fields.emailAddress?.required}\n isOptional={!fields.emailAddress?.required}\n isDisabled={fields.emailAddress?.disabled}\n autoComplete='email'\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_phone') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('phoneNumber') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('phoneNumber') && (\n <Form.ControlRow elementId='phoneNumber'>\n <Form.PhoneInput\n {...formState.phoneNumber.props}\n isRequired={fields.phoneNumber?.required}\n isOptional={!fields.phoneNumber?.required}\n autoComplete='tel'\n actionLabel={canToggleEmailPhone ? localizationKeys('signUp.start.actionLink__use_email') : undefined}\n onActionClicked={canToggleEmailPhone ? () => handleEmailPhoneToggle('emailAddress') : undefined}\n />\n </Form.ControlRow>\n )}\n {shouldShow('password') && (\n <Form.ControlRow elementId='password'>\n <Form.PasswordInput\n {...formState.password.props}\n isRequired={fields.password?.required}\n isOptional={!fields.password?.required}\n autoComplete='new-password'\n />\n </Form.ControlRow>\n )}\n </Col>\n )}\n <Col center>\n <Col\n gap={6}\n sx={{\n width: '100%',\n }}\n >\n {shouldShow('legalAccepted') && (\n <Form.ControlRow elementId='legalAccepted'>\n <LegalCheckbox\n {...formState.legalAccepted.props}\n isRequired={fields.legalAccepted?.required}\n />\n </Form.ControlRow>\n )}\n <Form.SubmitButton\n hasArrow\n localizationKey={localizationKeys('formButtonPrimary')}\n />\n </Col>\n </Col>\n </Form.Root>\n );\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,cAAc,UAA2B;CACpD,MAAM,EACJ,cACA,QACA,WACA,qBACA,2BAA2B,OAC3B,2BACE;CACJ,MAAM,EAAE,uBAAuB,cAAc,CAAC,CAAC;CAE/C,MAAM,cAAc,SAA8B;EAGhD,KAAK,SAAS,kBAAkB,SAAS,kBAAkB,qBACzD,OAAO,CAAC,CAAC,OAAO;EAGlB,OAAO,CAAC,CAAC,OAAO,UAAU,sBAAsB,OAAO,KAAK,EAAE;CAChE;CAEA,OACE,qBAAC,KAAK,MAAN;EACE,UAAU;EACV,KAAK;YAFP,CAIG,CAAC,4BACA,qBAAC,KAAD;GAAK,KAAK;aAAV;KACI,WAAW,WAAW,KAAK,WAAW,UAAU,MAChD,qBAAC,KAAK,YAAN;KACE,WAAU;KACV,IAAI,GACD,IA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