@clerk/ui 1.24.1 → 1.24.2-canary.v20260701154025
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/elements/SocialButtons.js +7 -5
- package/dist/elements/SocialButtons.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/no-rhc/ClerkUI.js +2 -2
- package/dist/no-rhc/elements/SocialButtons.js +7 -5
- package/dist/no-rhc/elements/SocialButtons.js.map +1 -1
- package/dist/no-rhc/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/{ui-common_ui_be75c0_1.24.1.js → ui-common_ui_5a968d_1.24.2-canary.v20260701154025.js} +1 -1
- package/dist/{ui-common_ui_2bed30_1.24.1.js → ui-common_ui_622dc8_1.24.2-canary.v20260701154025.js} +1 -1
- package/dist/{ui-common_ui_821323_1.24.1.js → ui-common_ui_b04c6b_1.24.2-canary.v20260701154025.js} +1 -1
- package/dist/ui.browser.js +2 -2
- package/dist/ui.legacy.browser.js +1 -1
- package/dist/ui.shared.browser.js +2 -2
- package/package.json +4 -4
- /package/dist/{4424_ui_be75c0_1.24.1.js → 4424_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{4424_ui_2bed30_1.24.1.js → 4424_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{4424_ui_821323_1.24.1.js → 4424_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{4718_ui_be75c0_1.24.1.js → 4718_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{4718_ui_2bed30_1.24.1.js → 4718_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{4718_ui_821323_1.24.1.js → 4718_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{6678_ui_be75c0_1.24.1.js → 6678_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{6678_ui_2bed30_1.24.1.js → 6678_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{6678_ui_821323_1.24.1.js → 6678_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{76_ui_be75c0_1.24.1.js → 76_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{76_ui_2bed30_1.24.1.js → 76_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{76_ui_821323_1.24.1.js → 76_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8316_ui_be75c0_1.24.1.js → 8316_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8316_ui_2bed30_1.24.1.js → 8316_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8316_ui_821323_1.24.1.js → 8316_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8746_ui_be75c0_1.24.1.js → 8746_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8746_ui_2bed30_1.24.1.js → 8746_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{8746_ui_821323_1.24.1.js → 8746_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9074_ui_be75c0_1.24.1.js → 9074_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9074_ui_2bed30_1.24.1.js → 9074_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9074_ui_821323_1.24.1.js → 9074_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9419_ui_be75c0_1.24.1.js → 9419_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9419_ui_2bed30_1.24.1.js → 9419_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{9419_ui_821323_1.24.1.js → 9419_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{apiKeys_ui_be75c0_1.24.1.js → apiKeys_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{apiKeys_ui_2bed30_1.24.1.js → apiKeys_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{apiKeys_ui_821323_1.24.1.js → apiKeys_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{blankcaptcha_ui_2bed30_1.24.1.js → blankcaptcha_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{blankcaptcha_ui_be75c0_1.24.1.js → blankcaptcha_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{blankcaptcha_ui_821323_1.24.1.js → blankcaptcha_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{checkout_ui_be75c0_1.24.1.js → checkout_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{checkout_ui_2bed30_1.24.1.js → checkout_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{checkout_ui_821323_1.24.1.js → checkout_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{configureSSO_ui_be75c0_1.24.1.js → configureSSO_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{configureSSO_ui_2bed30_1.24.1.js → configureSSO_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{configureSSO_ui_821323_1.24.1.js → configureSSO_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_be75c0_1.24.1.js → copy-api-key-modal_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_2bed30_1.24.1.js → copy-api-key-modal_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_821323_1.24.1.js → copy-api-key-modal_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{createorganization_ui_be75c0_1.24.1.js → createorganization_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{createorganization_ui_2bed30_1.24.1.js → createorganization_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{createorganization_ui_821323_1.24.1.js → createorganization_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{credit-history-page_ui_2bed30_1.24.1.js → credit-history-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{credit-history-page_ui_be75c0_1.24.1.js → credit-history-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{credit-history-page_ui_821323_1.24.1.js → credit-history-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_be75c0_1.24.1.js → enableOrganizationsPrompt_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_2bed30_1.24.1.js → enableOrganizationsPrompt_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_821323_1.24.1.js → enableOrganizationsPrompt_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{framework_ui_2bed30_1.24.1.js → framework_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{framework_ui_821323_1.24.1.js → framework_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{impersonationfab_ui_be75c0_1.24.1.js → impersonationfab_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{impersonationfab_ui_2bed30_1.24.1.js → impersonationfab_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{impersonationfab_ui_821323_1.24.1.js → impersonationfab_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{keylessPrompt_ui_be75c0_1.24.1.js → keylessPrompt_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{keylessPrompt_ui_2bed30_1.24.1.js → keylessPrompt_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{keylessPrompt_ui_821323_1.24.1.js → keylessPrompt_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{oauthConsent_ui_be75c0_1.24.1.js → oauthConsent_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{oauthConsent_ui_2bed30_1.24.1.js → oauthConsent_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{oauthConsent_ui_821323_1.24.1.js → oauthConsent_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{onetap_ui_be75c0_1.24.1.js → onetap_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{onetap_ui_2bed30_1.24.1.js → onetap_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{onetap_ui_821323_1.24.1.js → onetap_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-api-keys-page_ui_2bed30_1.24.1.js → op-api-keys-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-api-keys-page_ui_be75c0_1.24.1.js → op-api-keys-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-api-keys-page_ui_821323_1.24.1.js → op-api-keys-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-billing-page_ui_2bed30_1.24.1.js → op-billing-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-billing-page_ui_be75c0_1.24.1.js → op-billing-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-billing-page_ui_821323_1.24.1.js → op-billing-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-plans-page_ui_2bed30_1.24.1.js → op-plans-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-plans-page_ui_be75c0_1.24.1.js → op-plans-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-plans-page_ui_821323_1.24.1.js → op-plans-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-security-page_ui_be75c0_1.24.1.js → op-security-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-security-page_ui_2bed30_1.24.1.js → op-security-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{op-security-page_ui_821323_1.24.1.js → op-security-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationlist_ui_be75c0_1.24.1.js → organizationlist_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationlist_ui_2bed30_1.24.1.js → organizationlist_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationlist_ui_821323_1.24.1.js → organizationlist_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationprofile_ui_be75c0_1.24.1.js → organizationprofile_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationprofile_ui_2bed30_1.24.1.js → organizationprofile_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationprofile_ui_821323_1.24.1.js → organizationprofile_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationswitcher_ui_be75c0_1.24.1.js → organizationswitcher_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationswitcher_ui_2bed30_1.24.1.js → organizationswitcher_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{organizationswitcher_ui_821323_1.24.1.js → organizationswitcher_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{payment-attempt-page_ui_2bed30_1.24.1.js → payment-attempt-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{payment-attempt-page_ui_be75c0_1.24.1.js → payment-attempt-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{payment-attempt-page_ui_821323_1.24.1.js → payment-attempt-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{planDetails_ui_be75c0_1.24.1.js → planDetails_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{planDetails_ui_2bed30_1.24.1.js → planDetails_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{planDetails_ui_821323_1.24.1.js → planDetails_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_2bed30_1.24.1.js → prefetchorganizationlist_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_be75c0_1.24.1.js → prefetchorganizationlist_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_821323_1.24.1.js → prefetchorganizationlist_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{pricingTable_ui_be75c0_1.24.1.js → pricingTable_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{pricingTable_ui_2bed30_1.24.1.js → pricingTable_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{pricingTable_ui_821323_1.24.1.js → pricingTable_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_be75c0_1.24.1.js → revoke-api-key-modal_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_2bed30_1.24.1.js → revoke-api-key-modal_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_821323_1.24.1.js → revoke-api-key-modal_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{sessionTasks_ui_be75c0_1.24.1.js → sessionTasks_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{sessionTasks_ui_2bed30_1.24.1.js → sessionTasks_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{sessionTasks_ui_821323_1.24.1.js → sessionTasks_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signin_ui_be75c0_1.24.1.js → signin_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signin_ui_2bed30_1.24.1.js → signin_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signin_ui_821323_1.24.1.js → signin_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signup_ui_be75c0_1.24.1.js → signup_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signup_ui_2bed30_1.24.1.js → signup_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{signup_ui_821323_1.24.1.js → signup_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{statement-page_ui_be75c0_1.24.1.js → statement-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{statement-page_ui_2bed30_1.24.1.js → statement-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{statement-page_ui_821323_1.24.1.js → statement-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{subscriptionDetails_ui_be75c0_1.24.1.js → subscriptionDetails_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{subscriptionDetails_ui_2bed30_1.24.1.js → subscriptionDetails_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{subscriptionDetails_ui_821323_1.24.1.js → subscriptionDetails_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_be75c0_1.24.1.js → taskChooseOrganization_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_2bed30_1.24.1.js → taskChooseOrganization_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_821323_1.24.1.js → taskChooseOrganization_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskResetPassword_ui_be75c0_1.24.1.js → taskResetPassword_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskResetPassword_ui_2bed30_1.24.1.js → taskResetPassword_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskResetPassword_ui_821323_1.24.1.js → taskResetPassword_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskSetupMFA_ui_be75c0_1.24.1.js → taskSetupMFA_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskSetupMFA_ui_2bed30_1.24.1.js → taskSetupMFA_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{taskSetupMFA_ui_821323_1.24.1.js → taskSetupMFA_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-api-keys-page_ui_2bed30_1.24.1.js → up-api-keys-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-api-keys-page_ui_be75c0_1.24.1.js → up-api-keys-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-api-keys-page_ui_821323_1.24.1.js → up-api-keys-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-billing-page_ui_2bed30_1.24.1.js → up-billing-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-billing-page_ui_be75c0_1.24.1.js → up-billing-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-billing-page_ui_821323_1.24.1.js → up-billing-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-plans-page_ui_2bed30_1.24.1.js → up-plans-page_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-plans-page_ui_be75c0_1.24.1.js → up-plans-page_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{up-plans-page_ui_821323_1.24.1.js → up-plans-page_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{useravatar_ui_be75c0_1.24.1.js → useravatar_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{useravatar_ui_2bed30_1.24.1.js → useravatar_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{useravatar_ui_821323_1.24.1.js → useravatar_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userbutton_ui_be75c0_1.24.1.js → userbutton_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userbutton_ui_2bed30_1.24.1.js → userbutton_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userbutton_ui_821323_1.24.1.js → userbutton_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userprofile_ui_be75c0_1.24.1.js → userprofile_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userprofile_ui_2bed30_1.24.1.js → userprofile_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userprofile_ui_821323_1.24.1.js → userprofile_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userverification_ui_be75c0_1.24.1.js → userverification_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userverification_ui_2bed30_1.24.1.js → userverification_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{userverification_ui_821323_1.24.1.js → userverification_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{vendors_ui_be75c0_1.24.1.js → vendors_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{vendors_ui_2bed30_1.24.1.js → vendors_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{vendors_ui_821323_1.24.1.js → vendors_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{waitlist_ui_be75c0_1.24.1.js → waitlist_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{waitlist_ui_2bed30_1.24.1.js → waitlist_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{waitlist_ui_821323_1.24.1.js → waitlist_ui_b04c6b_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_be75c0_1.24.1.js → web3-solana-wallet-buttons_ui_5a968d_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_2bed30_1.24.1.js → web3-solana-wallet-buttons_ui_622dc8_1.24.2-canary.v20260701154025.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_821323_1.24.1.js → web3-solana-wallet-buttons_ui_b04c6b_1.24.2-canary.v20260701154025.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.24.
|
|
26
|
-
version = "1.24.
|
|
25
|
+
static version = "1.24.2-canary.v20260701154025";
|
|
26
|
+
version = "1.24.2-canary.v20260701154025";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
|
@@ -122,12 +122,14 @@ const SocialButtonIcon = forwardRef((props, ref) => {
|
|
|
122
122
|
variant: "outline",
|
|
123
123
|
colorScheme: "neutral",
|
|
124
124
|
hoverAsFocus: true,
|
|
125
|
-
sx:
|
|
126
|
-
minHeight: t.sizes.$8,
|
|
127
|
-
width: "100%"
|
|
128
|
-
}),
|
|
125
|
+
sx: { width: "100%" },
|
|
129
126
|
...rest,
|
|
130
|
-
children:
|
|
127
|
+
children: /* @__PURE__ */ jsx(Flex, {
|
|
128
|
+
as: "span",
|
|
129
|
+
center: true,
|
|
130
|
+
sx: { minHeight: "1lh" },
|
|
131
|
+
children: icon
|
|
132
|
+
})
|
|
131
133
|
});
|
|
132
134
|
});
|
|
133
135
|
const SocialButtonBlock = forwardRef((props, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocialButtons.js","names":[],"sources":["../../src/elements/SocialButtons.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { useClerk } from '@clerk/shared/react';\nimport type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/shared/types';\nimport type { Ref } from 'react';\nimport React, { forwardRef, isValidElement } from 'react';\n\nimport { ProviderIcon } from '../common';\nimport type { LocalizationKey } from '../customizables';\nimport {\n Button,\n descriptors,\n Flex,\n Grid,\n Icon,\n localizationKeys,\n SimpleButton,\n Spinner,\n Text,\n useAppearance,\n} from '../customizables';\nimport { useEnabledThirdPartyProviders } from '../hooks';\nimport { useTotalEnabledAuthMethods } from '../hooks/useTotalEnabledAuthMethods';\nimport { mqu, type PropsOfComponent } from '../styledSystem';\nimport { sleep } from '../utils/sleep';\nimport { LastAuthenticationStrategyBadge } from './Badge';\nimport { useCardState } from './contexts';\nimport { distributeStrategiesIntoRows } from './utils';\n\nconst SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;\nconst SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;\nconst MAX_STRATEGIES_PER_ROW = 5;\n\nexport type SocialButtonsProps = React.PropsWithChildren<{\n enableOAuthProviders: boolean;\n enableWeb3Providers: boolean;\n enableAlternativePhoneCodeProviders: boolean;\n}>;\n\ntype SocialButtonsRootProps = SocialButtonsProps & {\n oauthCallback: (strategy: OAuthStrategy) => Promise<unknown>;\n web3Callback: (strategy: Web3Strategy) => Promise<unknown>;\n alternativePhoneCodeCallback: (channel: PhoneCodeChannel) => void;\n idleAfterDelay?: boolean;\n showLastAuthenticationStrategy?: boolean;\n};\n\nconst isWeb3Strategy = (val: string): val is Web3Strategy => {\n return val.startsWith('web3_');\n};\n\nconst isPhoneCodeChannel = (val: string): val is PhoneCodeChannel => {\n return !!getAlternativePhoneCodeProviderData(val);\n};\n\nexport const SocialButtons = React.memo((props: SocialButtonsRootProps) => {\n const {\n oauthCallback,\n web3Callback,\n alternativePhoneCodeCallback,\n enableOAuthProviders = true,\n enableWeb3Providers = true,\n enableAlternativePhoneCodeProviders = true,\n idleAfterDelay = true,\n showLastAuthenticationStrategy = false,\n } = props;\n const { web3Strategies, authenticatableOauthStrategies, strategyToDisplayData, alternativePhoneCodeChannels } =\n useEnabledThirdPartyProviders();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const card = useCardState();\n const clerk = useClerk();\n const { socialButtonsVariant } = useAppearance().parsedOptions;\n\n type TStrategy = OAuthStrategy | Web3Strategy | PhoneCodeChannel;\n\n const strategies: TStrategy[] = [\n ...(enableOAuthProviders ? authenticatableOauthStrategies : []),\n ...(enableWeb3Providers ? web3Strategies : []),\n ...(enableAlternativePhoneCodeProviders ? alternativePhoneCodeChannels : []),\n ];\n\n if (!strategies.length) {\n return null;\n }\n\n const clientLastAuth = showLastAuthenticationStrategy ? clerk.client?.lastAuthenticationStrategy : null;\n\n const isValidStrategy = (strategy: unknown): strategy is TStrategy => {\n return strategies.includes(strategy as TStrategy);\n };\n\n // Convert SAML strategies to OAuth strategies for consistency when matching last used strategy.\n const convertedClientLastAuth = clientLastAuth?.startsWith('saml_')\n ? clientLastAuth.replace('saml_', 'oauth_')\n : clientLastAuth;\n\n const lastAuthenticationStrategy =\n convertedClientLastAuth && isValidStrategy(convertedClientLastAuth) ? convertedClientLastAuth : null;\n\n const { strategyRows, lastAuthenticationStrategyPresent } = distributeStrategiesIntoRows<TStrategy>(\n [...strategies],\n MAX_STRATEGIES_PER_ROW,\n lastAuthenticationStrategy,\n );\n const strategyRowOneLength = strategyRows.at(lastAuthenticationStrategyPresent ? 1 : 0)?.length ?? 0;\n const remainingStrategiesLength = lastAuthenticationStrategyPresent ? strategies.length - 1 : strategies.length;\n const shouldForceSingleColumnOnMobile = !lastAuthenticationStrategyPresent && strategies.length === 2;\n\n const preferBlockButtons =\n socialButtonsVariant === 'blockButton'\n ? true\n : socialButtonsVariant === 'iconButton'\n ? false\n : strategies.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD;\n\n const startOauth = async (strategy: OAuthStrategy | Web3Strategy) => {\n card.setLoading(strategy);\n try {\n if (isWeb3Strategy(strategy)) {\n await web3Callback(strategy);\n } else {\n await oauthCallback(strategy);\n }\n } catch {\n await sleep(1000);\n card.setIdle();\n }\n if (idleAfterDelay) {\n await sleep(5000);\n card.setIdle();\n }\n };\n\n const onSocialButtonClick = (strategy: OAuthStrategy | Web3Strategy | PhoneCodeChannel) => async () => {\n if (isPhoneCodeChannel(strategy)) {\n alternativePhoneCodeCallback(strategy);\n } else {\n await startOauth(strategy);\n }\n };\n\n const ButtonElement = preferBlockButtons ? SocialButtonBlock : SocialButtonIcon;\n\n return (\n <Flex\n direction='col'\n gap={2}\n elementDescriptor={descriptors.socialButtonsRoot}\n >\n {strategyRows.map((row, rowIndex) => (\n <Grid\n key={row.join('-')}\n elementDescriptor={descriptors.socialButtons}\n gap={2}\n sx={t => ({\n justifyContent: 'center',\n [mqu.sm]: {\n // Force single-column on mobile when 2 strategies are present (without last auth) to prevent\n // label overflow. When last auth is present, only 1 strategy remains here, so overflow isn't a concern.\n gridTemplateColumns: shouldForceSingleColumnOnMobile ? 'repeat(1, minmax(0, 1fr))' : undefined,\n },\n gridTemplateColumns:\n strategies.length < 1\n ? `repeat(1, minmax(0, 1fr))`\n : `repeat(${row.length}, ${\n rowIndex === 0\n ? `minmax(0, 1fr)`\n : // Calculate the width of each button based on the width of the buttons within the first row.\n // t.sizes.$2 is used here to represent the gap defined on the Grid component.\n `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t.sizes.$2}) / ${strategyRowOneLength}))`\n })`,\n })}\n >\n {row.map(strategy => {\n const shouldShowPreText =\n remainingStrategiesLength === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD ||\n (strategy === lastAuthenticationStrategy && row.length === 1);\n\n const label = shouldShowPreText\n ? `Continue with ${strategyToDisplayData[strategy].name}`\n : strategyToDisplayData[strategy].name;\n\n const localizedText = shouldShowPreText\n ? localizationKeys('socialButtonsBlockButton', {\n provider: strategyToDisplayData[strategy].name,\n })\n : localizationKeys('socialButtonsBlockButtonManyInView', {\n provider: strategyToDisplayData[strategy].name,\n });\n\n const imageOrInitial = (\n <ProviderIcon\n id={strategyToDisplayData[strategy].id}\n iconUrl={strategyToDisplayData[strategy].iconUrl}\n name={strategyToDisplayData[strategy].name}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n alt={`Sign in with ${strategyToDisplayData[strategy].name}`}\n elementDescriptor={[descriptors.providerIcon, descriptors.socialButtonsProviderIcon]}\n elementId={descriptors.socialButtonsProviderIcon.setId(strategyToDisplayData[strategy].id)}\n />\n );\n\n return (\n <ButtonElement\n key={strategy}\n id={strategyToDisplayData[strategy].id}\n onClick={onSocialButtonClick(strategy)}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n label={label}\n textLocalizationKey={localizedText}\n icon={imageOrInitial}\n lastAuthenticationStrategy={strategy === lastAuthenticationStrategy && totalEnabledAuthMethods > 1}\n />\n );\n })}\n </Grid>\n ))}\n </Flex>\n );\n});\n\ntype SocialButtonProps = PropsOfComponent<typeof Button> & {\n icon: React.ReactElement;\n id: OAuthProvider | Web3Provider | PhoneCodeChannel;\n textLocalizationKey: LocalizationKey | undefined;\n label?: string;\n lastAuthenticationStrategy?: boolean;\n};\n\nconst SocialButtonIcon = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { icon, label, id, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n\n if (lastAuthenticationStrategy) {\n return (\n <SocialButtonBlock\n {...props}\n ref={ref}\n />\n );\n }\n\n return (\n <Button\n ref={ref}\n elementDescriptor={descriptors.socialButtonsIconButton}\n elementId={descriptors.socialButtonsIconButton.setId(id)}\n textVariant='buttonLarge'\n variant='outline'\n colorScheme='neutral'\n hoverAsFocus\n sx={t => ({\n minHeight: t.sizes.$8,\n width: '100%',\n })}\n {...rest}\n >\n {icon}\n </Button>\n );\n});\n\nconst SocialButtonBlock = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { id, icon, isLoading, label, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n const isIconElement = isValidElement(icon);\n\n return (\n <SimpleButton\n elementDescriptor={descriptors.socialButtonsBlockButton}\n elementId={descriptors.socialButtonsBlockButton.setId(id)}\n variant='outline'\n block\n isLoading={isLoading}\n hoverAsFocus\n ref={ref}\n {...rest}\n sx={theme => [\n {\n gap: theme.space.$4,\n position: 'relative',\n justifyContent: 'flex-start',\n },\n props.sx,\n ]}\n >\n {lastAuthenticationStrategy && <LastAuthenticationStrategyBadge overlay />}\n\n <Flex\n justify='center'\n align='center'\n as='span'\n gap={3}\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n {(isLoading || icon) && (\n <Flex\n as='span'\n center\n sx={theme => ({ flex: `0 0 ${theme.space.$4}` })}\n >\n {isLoading ? (\n <Spinner\n size='sm'\n elementDescriptor={descriptors.spinner}\n />\n ) : !isIconElement && icon ? (\n <Icon\n icon={icon as unknown as React.ComponentType}\n sx={[\n theme => ({\n color: theme.colors.$neutralAlpha600,\n width: theme.sizes.$4,\n position: 'absolute',\n }),\n ]}\n />\n ) : (\n icon\n )}\n </Flex>\n )}\n <Text\n elementDescriptor={descriptors.socialButtonsBlockButtonText}\n elementId={descriptors.socialButtonsBlockButtonText.setId(id)}\n as='span'\n truncate\n variant='buttonLarge'\n localizationKey={textLocalizationKey}\n >\n {label}\n </Text>\n </Flex>\n </SimpleButton>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,gCAAgC;AACtC,MAAM,mCAAmC;AACzC,MAAM,yBAAyB;AAgB/B,MAAM,kBAAkB,QAAqC;CAC3D,OAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,MAAM,sBAAsB,QAAyC;CACnE,OAAO,CAAC,CAAC,oCAAoC,GAAG;AAClD;AAEA,MAAa,gBAAgB,MAAM,MAAM,UAAkC;CACzE,MAAM,EACJ,eACA,cACA,8BACA,uBAAuB,MACvB,sBAAsB,MACtB,sCAAsC,MACtC,iBAAiB,MACjB,iCAAiC,UAC/B;CACJ,MAAM,EAAE,gBAAgB,gCAAgC,uBAAuB,iCAC7E,8BAA8B;CAChC,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,OAAO,aAAa;CAC1B,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,yBAAyB,cAAc,CAAC,CAAC;CAIjD,MAAM,aAA0B;EAC9B,GAAI,uBAAuB,iCAAiC,CAAC;EAC7D,GAAI,sBAAsB,iBAAiB,CAAC;EAC5C,GAAI,sCAAsC,+BAA+B,CAAC;CAC5E;CAEA,IAAI,CAAC,WAAW,QACd,OAAO;CAGT,MAAM,iBAAiB,iCAAiC,MAAM,QAAQ,6BAA6B;CAEnG,MAAM,mBAAmB,aAA6C;EACpE,OAAO,WAAW,SAAS,QAAqB;CAClD;CAGA,MAAM,0BAA0B,gBAAgB,WAAW,OAAO,IAC9D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;GACR,WAAW,EAAE,MAAM;GACnB,OAAO;EACT;EACA,GAAI;YAEH;CACK;AAEZ,CAAC;AAED,MAAM,oBAAoB,YAAY,OAA0B,QAAoD;CAClH,MAAM,EAAE,IAAI,MAAM,WAAW,OAAO,qBAAqB,4BAA4B,GAAG,SAAS;CACjG,MAAM,gBAAgB,eAAe,IAAI;CAEzC,OACE,qBAAC,cAAD;EACE,mBAAmB,YAAY;EAC/B,WAAW,YAAY,yBAAyB,MAAM,EAAE;EACxD,SAAQ;EACR;EACW;EACX;EACK;EACL,GAAI;EACJ,KAAI,UAAS,CACX;GACE,KAAK,MAAM,MAAM;GACjB,UAAU;GACV,gBAAgB;EAClB,GACA,MAAM,EACR;YAhBF,CAkBG,8BAA8B,oBAAC,iCAAD,EAAiC,cAAS,IAEzE,qBAAC,MAAD;GACE,SAAQ;GACR,OAAM;GACN,IAAG;GACH,KAAK;GACL,IAAI;IACF,OAAO;IACP,UAAU;GACZ;aARF,EAUI,aAAa,SACb,oBAAC,MAAD;IACE,IAAG;IACH;IACA,KAAI,WAAU,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK;cAE7C,YACC,oBAAC,SAAD;KACE,MAAK;KACL,mBAAmB,YAAY;IAChC,KACC,CAAC,iBAAiB,OACpB,oBAAC,MAAD;KACQ;KACN,IAAI,EACF,WAAU;MACR,OAAO,MAAM,OAAO;MACpB,OAAO,MAAM,MAAM;MACnB,UAAU;KACZ,EACF;IACD,KAED;GAEE,IAER,oBAAC,MAAD;IACE,mBAAmB,YAAY;IAC/B,WAAW,YAAY,6BAA6B,MAAM,EAAE;IAC5D,IAAG;IACH;IACA,SAAQ;IACR,iBAAiB;cAEhB;GACG,EACF;IACM;;AAElB,CAAC"}
|
|
1
|
+
{"version":3,"file":"SocialButtons.js","names":[],"sources":["../../src/elements/SocialButtons.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { useClerk } from '@clerk/shared/react';\nimport type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/shared/types';\nimport type { Ref } from 'react';\nimport React, { forwardRef, isValidElement } from 'react';\n\nimport { ProviderIcon } from '../common';\nimport type { LocalizationKey } from '../customizables';\nimport {\n Button,\n descriptors,\n Flex,\n Grid,\n Icon,\n localizationKeys,\n SimpleButton,\n Spinner,\n Text,\n useAppearance,\n} from '../customizables';\nimport { useEnabledThirdPartyProviders } from '../hooks';\nimport { useTotalEnabledAuthMethods } from '../hooks/useTotalEnabledAuthMethods';\nimport { mqu, type PropsOfComponent } from '../styledSystem';\nimport { sleep } from '../utils/sleep';\nimport { LastAuthenticationStrategyBadge } from './Badge';\nimport { useCardState } from './contexts';\nimport { distributeStrategiesIntoRows } from './utils';\n\nconst SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;\nconst SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;\nconst MAX_STRATEGIES_PER_ROW = 5;\n\nexport type SocialButtonsProps = React.PropsWithChildren<{\n enableOAuthProviders: boolean;\n enableWeb3Providers: boolean;\n enableAlternativePhoneCodeProviders: boolean;\n}>;\n\ntype SocialButtonsRootProps = SocialButtonsProps & {\n oauthCallback: (strategy: OAuthStrategy) => Promise<unknown>;\n web3Callback: (strategy: Web3Strategy) => Promise<unknown>;\n alternativePhoneCodeCallback: (channel: PhoneCodeChannel) => void;\n idleAfterDelay?: boolean;\n showLastAuthenticationStrategy?: boolean;\n};\n\nconst isWeb3Strategy = (val: string): val is Web3Strategy => {\n return val.startsWith('web3_');\n};\n\nconst isPhoneCodeChannel = (val: string): val is PhoneCodeChannel => {\n return !!getAlternativePhoneCodeProviderData(val);\n};\n\nexport const SocialButtons = React.memo((props: SocialButtonsRootProps) => {\n const {\n oauthCallback,\n web3Callback,\n alternativePhoneCodeCallback,\n enableOAuthProviders = true,\n enableWeb3Providers = true,\n enableAlternativePhoneCodeProviders = true,\n idleAfterDelay = true,\n showLastAuthenticationStrategy = false,\n } = props;\n const { web3Strategies, authenticatableOauthStrategies, strategyToDisplayData, alternativePhoneCodeChannels } =\n useEnabledThirdPartyProviders();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const card = useCardState();\n const clerk = useClerk();\n const { socialButtonsVariant } = useAppearance().parsedOptions;\n\n type TStrategy = OAuthStrategy | Web3Strategy | PhoneCodeChannel;\n\n const strategies: TStrategy[] = [\n ...(enableOAuthProviders ? authenticatableOauthStrategies : []),\n ...(enableWeb3Providers ? web3Strategies : []),\n ...(enableAlternativePhoneCodeProviders ? alternativePhoneCodeChannels : []),\n ];\n\n if (!strategies.length) {\n return null;\n }\n\n const clientLastAuth = showLastAuthenticationStrategy ? clerk.client?.lastAuthenticationStrategy : null;\n\n const isValidStrategy = (strategy: unknown): strategy is TStrategy => {\n return strategies.includes(strategy as TStrategy);\n };\n\n // Convert SAML strategies to OAuth strategies for consistency when matching last used strategy.\n const convertedClientLastAuth = clientLastAuth?.startsWith('saml_')\n ? clientLastAuth.replace('saml_', 'oauth_')\n : clientLastAuth;\n\n const lastAuthenticationStrategy =\n convertedClientLastAuth && isValidStrategy(convertedClientLastAuth) ? convertedClientLastAuth : null;\n\n const { strategyRows, lastAuthenticationStrategyPresent } = distributeStrategiesIntoRows<TStrategy>(\n [...strategies],\n MAX_STRATEGIES_PER_ROW,\n lastAuthenticationStrategy,\n );\n const strategyRowOneLength = strategyRows.at(lastAuthenticationStrategyPresent ? 1 : 0)?.length ?? 0;\n const remainingStrategiesLength = lastAuthenticationStrategyPresent ? strategies.length - 1 : strategies.length;\n const shouldForceSingleColumnOnMobile = !lastAuthenticationStrategyPresent && strategies.length === 2;\n\n const preferBlockButtons =\n socialButtonsVariant === 'blockButton'\n ? true\n : socialButtonsVariant === 'iconButton'\n ? false\n : strategies.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD;\n\n const startOauth = async (strategy: OAuthStrategy | Web3Strategy) => {\n card.setLoading(strategy);\n try {\n if (isWeb3Strategy(strategy)) {\n await web3Callback(strategy);\n } else {\n await oauthCallback(strategy);\n }\n } catch {\n await sleep(1000);\n card.setIdle();\n }\n if (idleAfterDelay) {\n await sleep(5000);\n card.setIdle();\n }\n };\n\n const onSocialButtonClick = (strategy: OAuthStrategy | Web3Strategy | PhoneCodeChannel) => async () => {\n if (isPhoneCodeChannel(strategy)) {\n alternativePhoneCodeCallback(strategy);\n } else {\n await startOauth(strategy);\n }\n };\n\n const ButtonElement = preferBlockButtons ? SocialButtonBlock : SocialButtonIcon;\n\n return (\n <Flex\n direction='col'\n gap={2}\n elementDescriptor={descriptors.socialButtonsRoot}\n >\n {strategyRows.map((row, rowIndex) => (\n <Grid\n key={row.join('-')}\n elementDescriptor={descriptors.socialButtons}\n gap={2}\n sx={t => ({\n justifyContent: 'center',\n [mqu.sm]: {\n // Force single-column on mobile when 2 strategies are present (without last auth) to prevent\n // label overflow. When last auth is present, only 1 strategy remains here, so overflow isn't a concern.\n gridTemplateColumns: shouldForceSingleColumnOnMobile ? 'repeat(1, minmax(0, 1fr))' : undefined,\n },\n gridTemplateColumns:\n strategies.length < 1\n ? `repeat(1, minmax(0, 1fr))`\n : `repeat(${row.length}, ${\n rowIndex === 0\n ? `minmax(0, 1fr)`\n : // Calculate the width of each button based on the width of the buttons within the first row.\n // t.sizes.$2 is used here to represent the gap defined on the Grid component.\n `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t.sizes.$2}) / ${strategyRowOneLength}))`\n })`,\n })}\n >\n {row.map(strategy => {\n const shouldShowPreText =\n remainingStrategiesLength === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD ||\n (strategy === lastAuthenticationStrategy && row.length === 1);\n\n const label = shouldShowPreText\n ? `Continue with ${strategyToDisplayData[strategy].name}`\n : strategyToDisplayData[strategy].name;\n\n const localizedText = shouldShowPreText\n ? localizationKeys('socialButtonsBlockButton', {\n provider: strategyToDisplayData[strategy].name,\n })\n : localizationKeys('socialButtonsBlockButtonManyInView', {\n provider: strategyToDisplayData[strategy].name,\n });\n\n const imageOrInitial = (\n <ProviderIcon\n id={strategyToDisplayData[strategy].id}\n iconUrl={strategyToDisplayData[strategy].iconUrl}\n name={strategyToDisplayData[strategy].name}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n alt={`Sign in with ${strategyToDisplayData[strategy].name}`}\n elementDescriptor={[descriptors.providerIcon, descriptors.socialButtonsProviderIcon]}\n elementId={descriptors.socialButtonsProviderIcon.setId(strategyToDisplayData[strategy].id)}\n />\n );\n\n return (\n <ButtonElement\n key={strategy}\n id={strategyToDisplayData[strategy].id}\n onClick={onSocialButtonClick(strategy)}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n label={label}\n textLocalizationKey={localizedText}\n icon={imageOrInitial}\n lastAuthenticationStrategy={strategy === lastAuthenticationStrategy && totalEnabledAuthMethods > 1}\n />\n );\n })}\n </Grid>\n ))}\n </Flex>\n );\n});\n\ntype SocialButtonProps = PropsOfComponent<typeof Button> & {\n icon: React.ReactElement;\n id: OAuthProvider | Web3Provider | PhoneCodeChannel;\n textLocalizationKey: LocalizationKey | undefined;\n label?: string;\n lastAuthenticationStrategy?: boolean;\n};\n\nconst SocialButtonIcon = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { icon, label, id, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n\n if (lastAuthenticationStrategy) {\n return (\n <SocialButtonBlock\n {...props}\n ref={ref}\n />\n );\n }\n\n return (\n <Button\n ref={ref}\n elementDescriptor={descriptors.socialButtonsIconButton}\n elementId={descriptors.socialButtonsIconButton.setId(id)}\n textVariant='buttonLarge'\n variant='outline'\n colorScheme='neutral'\n hoverAsFocus\n sx={{ width: '100%' }}\n {...rest}\n >\n {/* Reserve one line of button text so the icon button matches the height of the\n block button (and its siblings) across any theme spacing/font size, instead of\n pinning to a static minHeight that stops tracking the text-based controls. */}\n <Flex\n as='span'\n center\n sx={{ minHeight: '1lh' }}\n >\n {icon}\n </Flex>\n </Button>\n );\n});\n\nconst SocialButtonBlock = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { id, icon, isLoading, label, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n const isIconElement = isValidElement(icon);\n\n return (\n <SimpleButton\n elementDescriptor={descriptors.socialButtonsBlockButton}\n elementId={descriptors.socialButtonsBlockButton.setId(id)}\n variant='outline'\n block\n isLoading={isLoading}\n hoverAsFocus\n ref={ref}\n {...rest}\n sx={theme => [\n {\n gap: theme.space.$4,\n position: 'relative',\n justifyContent: 'flex-start',\n },\n props.sx,\n ]}\n >\n {lastAuthenticationStrategy && <LastAuthenticationStrategyBadge overlay />}\n\n <Flex\n justify='center'\n align='center'\n as='span'\n gap={3}\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n {(isLoading || icon) && (\n <Flex\n as='span'\n center\n sx={theme => ({ flex: `0 0 ${theme.space.$4}` })}\n >\n {isLoading ? (\n <Spinner\n size='sm'\n elementDescriptor={descriptors.spinner}\n />\n ) : !isIconElement && icon ? (\n <Icon\n icon={icon as unknown as React.ComponentType}\n sx={[\n theme => ({\n color: theme.colors.$neutralAlpha600,\n width: theme.sizes.$4,\n position: 'absolute',\n }),\n ]}\n />\n ) : (\n icon\n )}\n </Flex>\n )}\n <Text\n elementDescriptor={descriptors.socialButtonsBlockButtonText}\n elementId={descriptors.socialButtonsBlockButtonText.setId(id)}\n as='span'\n truncate\n variant='buttonLarge'\n localizationKey={textLocalizationKey}\n >\n {label}\n </Text>\n </Flex>\n </SimpleButton>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,gCAAgC;AACtC,MAAM,mCAAmC;AACzC,MAAM,yBAAyB;AAgB/B,MAAM,kBAAkB,QAAqC;CAC3D,OAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,MAAM,sBAAsB,QAAyC;CACnE,OAAO,CAAC,CAAC,oCAAoC,GAAG;AAClD;AAEA,MAAa,g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ACN,IAAG;GACH,KAAK;GACL,IAAI;IACF,OAAO;IACP,UAAU;GACZ;aARF,EAUI,aAAa,SACb,oBAAC,MAAD;IACE,IAAG;IACH;IACA,KAAI,WAAU,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK;cAE7C,YACC,oBAAC,SAAD;KACE,MAAK;KACL,mBAAmB,YAAY;IAChC,KACC,CAAC,iBAAiB,OACpB,oBAAC,MAAD;KACQ;KACN,IAAI,EACF,WAAU;MACR,OAAO,MAAM,OAAO;MACpB,OAAO,MAAM,MAAM;MACnB,UAAU;KACZ,EACF;IACD,KAED;GAEE,IAER,oBAAC,MAAD;IACE,mBAAmB,YAAY;IAC/B,WAAW,YAAY,6BAA6B,MAAM,EAAE;IAC5D,IAAG;IACH;IACA,SAAQ;IACR,iBAAiB;cAEhB;GACG,EACF;IACM;;AAElB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/no-rhc/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.24.
|
|
26
|
-
version = "1.24.
|
|
25
|
+
static version = "1.24.2-canary.v20260701154025";
|
|
26
|
+
version = "1.24.2-canary.v20260701154025";
|
|
27
27
|
#componentRenderer;
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new `ClerkUI` instance and mounts the internal component renderer.
|
|
@@ -122,12 +122,14 @@ const SocialButtonIcon = forwardRef((props, ref) => {
|
|
|
122
122
|
variant: "outline",
|
|
123
123
|
colorScheme: "neutral",
|
|
124
124
|
hoverAsFocus: true,
|
|
125
|
-
sx:
|
|
126
|
-
minHeight: t.sizes.$8,
|
|
127
|
-
width: "100%"
|
|
128
|
-
}),
|
|
125
|
+
sx: { width: "100%" },
|
|
129
126
|
...rest,
|
|
130
|
-
children:
|
|
127
|
+
children: /* @__PURE__ */ jsx(Flex, {
|
|
128
|
+
as: "span",
|
|
129
|
+
center: true,
|
|
130
|
+
sx: { minHeight: "1lh" },
|
|
131
|
+
children: icon
|
|
132
|
+
})
|
|
131
133
|
});
|
|
132
134
|
});
|
|
133
135
|
const SocialButtonBlock = forwardRef((props, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocialButtons.js","names":[],"sources":["../../../src/elements/SocialButtons.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { useClerk } from '@clerk/shared/react';\nimport type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/shared/types';\nimport type { Ref } from 'react';\nimport React, { forwardRef, isValidElement } from 'react';\n\nimport { ProviderIcon } from '../common';\nimport type { LocalizationKey } from '../customizables';\nimport {\n Button,\n descriptors,\n Flex,\n Grid,\n Icon,\n localizationKeys,\n SimpleButton,\n Spinner,\n Text,\n useAppearance,\n} from '../customizables';\nimport { useEnabledThirdPartyProviders } from '../hooks';\nimport { useTotalEnabledAuthMethods } from '../hooks/useTotalEnabledAuthMethods';\nimport { mqu, type PropsOfComponent } from '../styledSystem';\nimport { sleep } from '../utils/sleep';\nimport { LastAuthenticationStrategyBadge } from './Badge';\nimport { useCardState } from './contexts';\nimport { distributeStrategiesIntoRows } from './utils';\n\nconst SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;\nconst SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;\nconst MAX_STRATEGIES_PER_ROW = 5;\n\nexport type SocialButtonsProps = React.PropsWithChildren<{\n enableOAuthProviders: boolean;\n enableWeb3Providers: boolean;\n enableAlternativePhoneCodeProviders: boolean;\n}>;\n\ntype SocialButtonsRootProps = SocialButtonsProps & {\n oauthCallback: (strategy: OAuthStrategy) => Promise<unknown>;\n web3Callback: (strategy: Web3Strategy) => Promise<unknown>;\n alternativePhoneCodeCallback: (channel: PhoneCodeChannel) => void;\n idleAfterDelay?: boolean;\n showLastAuthenticationStrategy?: boolean;\n};\n\nconst isWeb3Strategy = (val: string): val is Web3Strategy => {\n return val.startsWith('web3_');\n};\n\nconst isPhoneCodeChannel = (val: string): val is PhoneCodeChannel => {\n return !!getAlternativePhoneCodeProviderData(val);\n};\n\nexport const SocialButtons = React.memo((props: SocialButtonsRootProps) => {\n const {\n oauthCallback,\n web3Callback,\n alternativePhoneCodeCallback,\n enableOAuthProviders = true,\n enableWeb3Providers = true,\n enableAlternativePhoneCodeProviders = true,\n idleAfterDelay = true,\n showLastAuthenticationStrategy = false,\n } = props;\n const { web3Strategies, authenticatableOauthStrategies, strategyToDisplayData, alternativePhoneCodeChannels } =\n useEnabledThirdPartyProviders();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const card = useCardState();\n const clerk = useClerk();\n const { socialButtonsVariant } = useAppearance().parsedOptions;\n\n type TStrategy = OAuthStrategy | Web3Strategy | PhoneCodeChannel;\n\n const strategies: TStrategy[] = [\n ...(enableOAuthProviders ? authenticatableOauthStrategies : []),\n ...(enableWeb3Providers ? web3Strategies : []),\n ...(enableAlternativePhoneCodeProviders ? alternativePhoneCodeChannels : []),\n ];\n\n if (!strategies.length) {\n return null;\n }\n\n const clientLastAuth = showLastAuthenticationStrategy ? clerk.client?.lastAuthenticationStrategy : null;\n\n const isValidStrategy = (strategy: unknown): strategy is TStrategy => {\n return strategies.includes(strategy as TStrategy);\n };\n\n // Convert SAML strategies to OAuth strategies for consistency when matching last used strategy.\n const convertedClientLastAuth = clientLastAuth?.startsWith('saml_')\n ? clientLastAuth.replace('saml_', 'oauth_')\n : clientLastAuth;\n\n const lastAuthenticationStrategy =\n convertedClientLastAuth && isValidStrategy(convertedClientLastAuth) ? convertedClientLastAuth : null;\n\n const { strategyRows, lastAuthenticationStrategyPresent } = distributeStrategiesIntoRows<TStrategy>(\n [...strategies],\n MAX_STRATEGIES_PER_ROW,\n lastAuthenticationStrategy,\n );\n const strategyRowOneLength = strategyRows.at(lastAuthenticationStrategyPresent ? 1 : 0)?.length ?? 0;\n const remainingStrategiesLength = lastAuthenticationStrategyPresent ? strategies.length - 1 : strategies.length;\n const shouldForceSingleColumnOnMobile = !lastAuthenticationStrategyPresent && strategies.length === 2;\n\n const preferBlockButtons =\n socialButtonsVariant === 'blockButton'\n ? true\n : socialButtonsVariant === 'iconButton'\n ? false\n : strategies.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD;\n\n const startOauth = async (strategy: OAuthStrategy | Web3Strategy) => {\n card.setLoading(strategy);\n try {\n if (isWeb3Strategy(strategy)) {\n await web3Callback(strategy);\n } else {\n await oauthCallback(strategy);\n }\n } catch {\n await sleep(1000);\n card.setIdle();\n }\n if (idleAfterDelay) {\n await sleep(5000);\n card.setIdle();\n }\n };\n\n const onSocialButtonClick = (strategy: OAuthStrategy | Web3Strategy | PhoneCodeChannel) => async () => {\n if (isPhoneCodeChannel(strategy)) {\n alternativePhoneCodeCallback(strategy);\n } else {\n await startOauth(strategy);\n }\n };\n\n const ButtonElement = preferBlockButtons ? SocialButtonBlock : SocialButtonIcon;\n\n return (\n <Flex\n direction='col'\n gap={2}\n elementDescriptor={descriptors.socialButtonsRoot}\n >\n {strategyRows.map((row, rowIndex) => (\n <Grid\n key={row.join('-')}\n elementDescriptor={descriptors.socialButtons}\n gap={2}\n sx={t => ({\n justifyContent: 'center',\n [mqu.sm]: {\n // Force single-column on mobile when 2 strategies are present (without last auth) to prevent\n // label overflow. When last auth is present, only 1 strategy remains here, so overflow isn't a concern.\n gridTemplateColumns: shouldForceSingleColumnOnMobile ? 'repeat(1, minmax(0, 1fr))' : undefined,\n },\n gridTemplateColumns:\n strategies.length < 1\n ? `repeat(1, minmax(0, 1fr))`\n : `repeat(${row.length}, ${\n rowIndex === 0\n ? `minmax(0, 1fr)`\n : // Calculate the width of each button based on the width of the buttons within the first row.\n // t.sizes.$2 is used here to represent the gap defined on the Grid component.\n `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t.sizes.$2}) / ${strategyRowOneLength}))`\n })`,\n })}\n >\n {row.map(strategy => {\n const shouldShowPreText =\n remainingStrategiesLength === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD ||\n (strategy === lastAuthenticationStrategy && row.length === 1);\n\n const label = shouldShowPreText\n ? `Continue with ${strategyToDisplayData[strategy].name}`\n : strategyToDisplayData[strategy].name;\n\n const localizedText = shouldShowPreText\n ? localizationKeys('socialButtonsBlockButton', {\n provider: strategyToDisplayData[strategy].name,\n })\n : localizationKeys('socialButtonsBlockButtonManyInView', {\n provider: strategyToDisplayData[strategy].name,\n });\n\n const imageOrInitial = (\n <ProviderIcon\n id={strategyToDisplayData[strategy].id}\n iconUrl={strategyToDisplayData[strategy].iconUrl}\n name={strategyToDisplayData[strategy].name}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n alt={`Sign in with ${strategyToDisplayData[strategy].name}`}\n elementDescriptor={[descriptors.providerIcon, descriptors.socialButtonsProviderIcon]}\n elementId={descriptors.socialButtonsProviderIcon.setId(strategyToDisplayData[strategy].id)}\n />\n );\n\n return (\n <ButtonElement\n key={strategy}\n id={strategyToDisplayData[strategy].id}\n onClick={onSocialButtonClick(strategy)}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n label={label}\n textLocalizationKey={localizedText}\n icon={imageOrInitial}\n lastAuthenticationStrategy={strategy === lastAuthenticationStrategy && totalEnabledAuthMethods > 1}\n />\n );\n })}\n </Grid>\n ))}\n </Flex>\n );\n});\n\ntype SocialButtonProps = PropsOfComponent<typeof Button> & {\n icon: React.ReactElement;\n id: OAuthProvider | Web3Provider | PhoneCodeChannel;\n textLocalizationKey: LocalizationKey | undefined;\n label?: string;\n lastAuthenticationStrategy?: boolean;\n};\n\nconst SocialButtonIcon = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { icon, label, id, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n\n if (lastAuthenticationStrategy) {\n return (\n <SocialButtonBlock\n {...props}\n ref={ref}\n />\n );\n }\n\n return (\n <Button\n ref={ref}\n elementDescriptor={descriptors.socialButtonsIconButton}\n elementId={descriptors.socialButtonsIconButton.setId(id)}\n textVariant='buttonLarge'\n variant='outline'\n colorScheme='neutral'\n hoverAsFocus\n sx={t => ({\n minHeight: t.sizes.$8,\n width: '100%',\n })}\n {...rest}\n >\n {icon}\n </Button>\n );\n});\n\nconst SocialButtonBlock = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { id, icon, isLoading, label, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n const isIconElement = isValidElement(icon);\n\n return (\n <SimpleButton\n elementDescriptor={descriptors.socialButtonsBlockButton}\n elementId={descriptors.socialButtonsBlockButton.setId(id)}\n variant='outline'\n block\n isLoading={isLoading}\n hoverAsFocus\n ref={ref}\n {...rest}\n sx={theme => [\n {\n gap: theme.space.$4,\n position: 'relative',\n justifyContent: 'flex-start',\n },\n props.sx,\n ]}\n >\n {lastAuthenticationStrategy && <LastAuthenticationStrategyBadge overlay />}\n\n <Flex\n justify='center'\n align='center'\n as='span'\n gap={3}\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n {(isLoading || icon) && (\n <Flex\n as='span'\n center\n sx={theme => ({ flex: `0 0 ${theme.space.$4}` })}\n >\n {isLoading ? (\n <Spinner\n size='sm'\n elementDescriptor={descriptors.spinner}\n />\n ) : !isIconElement && icon ? (\n <Icon\n icon={icon as unknown as React.ComponentType}\n sx={[\n theme => ({\n color: theme.colors.$neutralAlpha600,\n width: theme.sizes.$4,\n position: 'absolute',\n }),\n ]}\n />\n ) : (\n icon\n )}\n </Flex>\n )}\n <Text\n elementDescriptor={descriptors.socialButtonsBlockButtonText}\n elementId={descriptors.socialButtonsBlockButtonText.setId(id)}\n as='span'\n truncate\n variant='buttonLarge'\n localizationKey={textLocalizationKey}\n >\n {label}\n </Text>\n </Flex>\n </SimpleButton>\n );\n});\n"],"m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ACL,GAAI;EACJ,KAAI,UAAS,CACX;GACE,KAAK,MAAM,MAAM;GACjB,UAAU;GACV,gBAAgB;EAClB,GACA,MAAM,EACR;YAhBF,CAkBG,8BAA8B,oBAAC,iCAAD,EAAiC,cAAS,IAEzE,qBAAC,MAAD;GACE,SAAQ;GACR,OAAM;GACN,IAAG;GACH,KAAK;GACL,IAAI;IACF,OAAO;IACP,UAAU;GACZ;aARF,EAUI,aAAa,SACb,oBAAC,MAAD;IACE,IAAG;IACH;IACA,KAAI,WAAU,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK;cAE7C,YACC,oBAAC,SAAD;KACE,MAAK;KACL,mBAAmB,YAAY;IAChC,KACC,CAAC,iBAAiB,OACpB,oBAAC,MAAD;KACQ;KACN,IAAI,EACF,WAAU;MACR,OAAO,MAAM,OAAO;MACpB,OAAO,MAAM,MAAM;MACnB,UAAU;KACZ,EACF;IACD,KAED;GAEE,IAER,oBAAC,MAAD;IACE,mBAAmB,YAAY;IAC/B,WAAW,YAAY,6BAA6B,MAAM,EAAE;IAC5D,IAAG;IACH;IACA,SAAQ;IACR,iBAAiB;cAEhB;GACG,EACF;IACM;;AAElB,CAAC"}
|
|
1
|
+
{"version":3,"file":"SocialButtons.js","names":[],"sources":["../../../src/elements/SocialButtons.tsx"],"sourcesContent":["import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode';\nimport { useClerk } from '@clerk/shared/react';\nimport type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/shared/types';\nimport type { Ref } from 'react';\nimport React, { forwardRef, isValidElement } from 'react';\n\nimport { ProviderIcon } from '../common';\nimport type { LocalizationKey } from '../customizables';\nimport {\n Button,\n descriptors,\n Flex,\n Grid,\n Icon,\n localizationKeys,\n SimpleButton,\n Spinner,\n Text,\n useAppearance,\n} from '../customizables';\nimport { useEnabledThirdPartyProviders } from '../hooks';\nimport { useTotalEnabledAuthMethods } from '../hooks/useTotalEnabledAuthMethods';\nimport { mqu, type PropsOfComponent } from '../styledSystem';\nimport { sleep } from '../utils/sleep';\nimport { LastAuthenticationStrategyBadge } from './Badge';\nimport { useCardState } from './contexts';\nimport { distributeStrategiesIntoRows } from './utils';\n\nconst SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;\nconst SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;\nconst MAX_STRATEGIES_PER_ROW = 5;\n\nexport type SocialButtonsProps = React.PropsWithChildren<{\n enableOAuthProviders: boolean;\n enableWeb3Providers: boolean;\n enableAlternativePhoneCodeProviders: boolean;\n}>;\n\ntype SocialButtonsRootProps = SocialButtonsProps & {\n oauthCallback: (strategy: OAuthStrategy) => Promise<unknown>;\n web3Callback: (strategy: Web3Strategy) => Promise<unknown>;\n alternativePhoneCodeCallback: (channel: PhoneCodeChannel) => void;\n idleAfterDelay?: boolean;\n showLastAuthenticationStrategy?: boolean;\n};\n\nconst isWeb3Strategy = (val: string): val is Web3Strategy => {\n return val.startsWith('web3_');\n};\n\nconst isPhoneCodeChannel = (val: string): val is PhoneCodeChannel => {\n return !!getAlternativePhoneCodeProviderData(val);\n};\n\nexport const SocialButtons = React.memo((props: SocialButtonsRootProps) => {\n const {\n oauthCallback,\n web3Callback,\n alternativePhoneCodeCallback,\n enableOAuthProviders = true,\n enableWeb3Providers = true,\n enableAlternativePhoneCodeProviders = true,\n idleAfterDelay = true,\n showLastAuthenticationStrategy = false,\n } = props;\n const { web3Strategies, authenticatableOauthStrategies, strategyToDisplayData, alternativePhoneCodeChannels } =\n useEnabledThirdPartyProviders();\n const totalEnabledAuthMethods = useTotalEnabledAuthMethods();\n const card = useCardState();\n const clerk = useClerk();\n const { socialButtonsVariant } = useAppearance().parsedOptions;\n\n type TStrategy = OAuthStrategy | Web3Strategy | PhoneCodeChannel;\n\n const strategies: TStrategy[] = [\n ...(enableOAuthProviders ? authenticatableOauthStrategies : []),\n ...(enableWeb3Providers ? web3Strategies : []),\n ...(enableAlternativePhoneCodeProviders ? alternativePhoneCodeChannels : []),\n ];\n\n if (!strategies.length) {\n return null;\n }\n\n const clientLastAuth = showLastAuthenticationStrategy ? clerk.client?.lastAuthenticationStrategy : null;\n\n const isValidStrategy = (strategy: unknown): strategy is TStrategy => {\n return strategies.includes(strategy as TStrategy);\n };\n\n // Convert SAML strategies to OAuth strategies for consistency when matching last used strategy.\n const convertedClientLastAuth = clientLastAuth?.startsWith('saml_')\n ? clientLastAuth.replace('saml_', 'oauth_')\n : clientLastAuth;\n\n const lastAuthenticationStrategy =\n convertedClientLastAuth && isValidStrategy(convertedClientLastAuth) ? convertedClientLastAuth : null;\n\n const { strategyRows, lastAuthenticationStrategyPresent } = distributeStrategiesIntoRows<TStrategy>(\n [...strategies],\n MAX_STRATEGIES_PER_ROW,\n lastAuthenticationStrategy,\n );\n const strategyRowOneLength = strategyRows.at(lastAuthenticationStrategyPresent ? 1 : 0)?.length ?? 0;\n const remainingStrategiesLength = lastAuthenticationStrategyPresent ? strategies.length - 1 : strategies.length;\n const shouldForceSingleColumnOnMobile = !lastAuthenticationStrategyPresent && strategies.length === 2;\n\n const preferBlockButtons =\n socialButtonsVariant === 'blockButton'\n ? true\n : socialButtonsVariant === 'iconButton'\n ? false\n : strategies.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD;\n\n const startOauth = async (strategy: OAuthStrategy | Web3Strategy) => {\n card.setLoading(strategy);\n try {\n if (isWeb3Strategy(strategy)) {\n await web3Callback(strategy);\n } else {\n await oauthCallback(strategy);\n }\n } catch {\n await sleep(1000);\n card.setIdle();\n }\n if (idleAfterDelay) {\n await sleep(5000);\n card.setIdle();\n }\n };\n\n const onSocialButtonClick = (strategy: OAuthStrategy | Web3Strategy | PhoneCodeChannel) => async () => {\n if (isPhoneCodeChannel(strategy)) {\n alternativePhoneCodeCallback(strategy);\n } else {\n await startOauth(strategy);\n }\n };\n\n const ButtonElement = preferBlockButtons ? SocialButtonBlock : SocialButtonIcon;\n\n return (\n <Flex\n direction='col'\n gap={2}\n elementDescriptor={descriptors.socialButtonsRoot}\n >\n {strategyRows.map((row, rowIndex) => (\n <Grid\n key={row.join('-')}\n elementDescriptor={descriptors.socialButtons}\n gap={2}\n sx={t => ({\n justifyContent: 'center',\n [mqu.sm]: {\n // Force single-column on mobile when 2 strategies are present (without last auth) to prevent\n // label overflow. When last auth is present, only 1 strategy remains here, so overflow isn't a concern.\n gridTemplateColumns: shouldForceSingleColumnOnMobile ? 'repeat(1, minmax(0, 1fr))' : undefined,\n },\n gridTemplateColumns:\n strategies.length < 1\n ? `repeat(1, minmax(0, 1fr))`\n : `repeat(${row.length}, ${\n rowIndex === 0\n ? `minmax(0, 1fr)`\n : // Calculate the width of each button based on the width of the buttons within the first row.\n // t.sizes.$2 is used here to represent the gap defined on the Grid component.\n `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t.sizes.$2}) / ${strategyRowOneLength}))`\n })`,\n })}\n >\n {row.map(strategy => {\n const shouldShowPreText =\n remainingStrategiesLength === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD ||\n (strategy === lastAuthenticationStrategy && row.length === 1);\n\n const label = shouldShowPreText\n ? `Continue with ${strategyToDisplayData[strategy].name}`\n : strategyToDisplayData[strategy].name;\n\n const localizedText = shouldShowPreText\n ? localizationKeys('socialButtonsBlockButton', {\n provider: strategyToDisplayData[strategy].name,\n })\n : localizationKeys('socialButtonsBlockButtonManyInView', {\n provider: strategyToDisplayData[strategy].name,\n });\n\n const imageOrInitial = (\n <ProviderIcon\n id={strategyToDisplayData[strategy].id}\n iconUrl={strategyToDisplayData[strategy].iconUrl}\n name={strategyToDisplayData[strategy].name}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n alt={`Sign in with ${strategyToDisplayData[strategy].name}`}\n elementDescriptor={[descriptors.providerIcon, descriptors.socialButtonsProviderIcon]}\n elementId={descriptors.socialButtonsProviderIcon.setId(strategyToDisplayData[strategy].id)}\n />\n );\n\n return (\n <ButtonElement\n key={strategy}\n id={strategyToDisplayData[strategy].id}\n onClick={onSocialButtonClick(strategy)}\n isLoading={card.loadingMetadata === strategy}\n isDisabled={card.isLoading}\n label={label}\n textLocalizationKey={localizedText}\n icon={imageOrInitial}\n lastAuthenticationStrategy={strategy === lastAuthenticationStrategy && totalEnabledAuthMethods > 1}\n />\n );\n })}\n </Grid>\n ))}\n </Flex>\n );\n});\n\ntype SocialButtonProps = PropsOfComponent<typeof Button> & {\n icon: React.ReactElement;\n id: OAuthProvider | Web3Provider | PhoneCodeChannel;\n textLocalizationKey: LocalizationKey | undefined;\n label?: string;\n lastAuthenticationStrategy?: boolean;\n};\n\nconst SocialButtonIcon = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { icon, label, id, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n\n if (lastAuthenticationStrategy) {\n return (\n <SocialButtonBlock\n {...props}\n ref={ref}\n />\n );\n }\n\n return (\n <Button\n ref={ref}\n elementDescriptor={descriptors.socialButtonsIconButton}\n elementId={descriptors.socialButtonsIconButton.setId(id)}\n textVariant='buttonLarge'\n variant='outline'\n colorScheme='neutral'\n hoverAsFocus\n sx={{ width: '100%' }}\n {...rest}\n >\n {/* Reserve one line of button text so the icon button matches the height of the\n block button (and its siblings) across any theme spacing/font size, instead of\n pinning to a static minHeight that stops tracking the text-based controls. */}\n <Flex\n as='span'\n center\n sx={{ minHeight: '1lh' }}\n >\n {icon}\n </Flex>\n </Button>\n );\n});\n\nconst SocialButtonBlock = forwardRef((props: SocialButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { id, icon, isLoading, label, textLocalizationKey, lastAuthenticationStrategy, ...rest } = props;\n const isIconElement = isValidElement(icon);\n\n return (\n <SimpleButton\n elementDescriptor={descriptors.socialButtonsBlockButton}\n elementId={descriptors.socialButtonsBlockButton.setId(id)}\n variant='outline'\n block\n isLoading={isLoading}\n hoverAsFocus\n ref={ref}\n {...rest}\n sx={theme => [\n {\n gap: theme.space.$4,\n position: 'relative',\n justifyContent: 'flex-start',\n },\n props.sx,\n ]}\n >\n {lastAuthenticationStrategy && <LastAuthenticationStrategyBadge overlay />}\n\n <Flex\n justify='center'\n align='center'\n as='span'\n gap={3}\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n {(isLoading || icon) && (\n <Flex\n as='span'\n center\n sx={theme => ({ flex: `0 0 ${theme.space.$4}` })}\n >\n {isLoading ? (\n <Spinner\n size='sm'\n elementDescriptor={descriptors.spinner}\n />\n ) : !isIconElement && icon ? (\n <Icon\n icon={icon as unknown as React.ComponentType}\n sx={[\n theme => ({\n color: theme.colors.$neutralAlpha600,\n width: theme.sizes.$4,\n position: 'absolute',\n }),\n ]}\n />\n ) : (\n icon\n )}\n </Flex>\n )}\n <Text\n elementDescriptor={descriptors.socialButtonsBlockButtonText}\n elementId={descriptors.socialButtonsBlockButtonText.setId(id)}\n as='span'\n truncate\n variant='buttonLarge'\n localizationKey={textLocalizationKey}\n >\n {label}\n </Text>\n </Flex>\n </SimpleButton>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,gCAAgC;AACtC,MAAM,mCAAmC;AACzC,MAAM,yBAAyB;AAgB/B,MAAM,kBAAkB,QAAqC;CAC3D,OAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,MAAM,sBAAsB,QAAyC;CACnE,OAAO,CAAC,CAAC,oCAAoC,GAAG;AAClD;AAEA,MAAa,gBAAgB,MAAM,MAAM,UAAkC;CACzE,MAAM,EACJ,eACA,cACA,8BACA,uBAAuB,MACvB,sBAAsB,MACtB,sCAAsC,MACtC,iBAAiB,MACjB,iCAAiC,UAC/B;CACJ,MAAM,EAAE,gBAAgB,gCAAgC,uBAAuB,iCAC7E,8BAA8B;CAChC,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,OAAO,aAAa;CAC1B,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,yBAAyB,cAAc,CAAC,CAAC;CAIjD,MAAM,aAA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