@coinbase/cdp-react 0.0.18 → 0.0.19
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/assets/Button.css +1 -1
- package/dist/assets/EmailForm.css +1 -0
- package/dist/assets/Error.css +1 -1
- package/dist/assets/Field.css +1 -1
- package/dist/assets/FlowEmailOTP.css +1 -0
- package/dist/assets/FlowPhoneNumberOTP.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Label.css +1 -0
- package/dist/assets/OTP.css +1 -1
- package/dist/assets/OTPForm.css +1 -0
- package/dist/assets/PhoneNumberForm.css +1 -0
- package/dist/assets/PhoneNumberInput.css +1 -0
- package/dist/assets/SignIn.css +1 -1
- package/dist/assets/SignInAuthMethodButtons.css +1 -0
- package/dist/assets/SignInBackButton.css +1 -0
- package/dist/assets/SignInCredentials.css +1 -0
- package/dist/assets/SignInDescription.css +1 -1
- package/dist/assets/SignInFooter.css +1 -0
- package/dist/assets/SignInForm.css +1 -1
- package/dist/assets/SignInImage.css +1 -1
- package/dist/assets/SignInModal.css +1 -1
- package/dist/assets/SignInTitle.css +1 -1
- package/dist/assets/SuccessMessage.css +1 -0
- package/dist/assets/SwitchFadeTransition.css +1 -0
- package/dist/assets/SwitchSlideTransition.css +1 -0
- package/dist/assets/SwitchTransition.css +1 -0
- package/dist/assets/ThemeProvider.css +1 -1
- package/dist/chunks/index.BzllgVaP.js +12 -0
- package/dist/components/AuthButton/index.js +1 -1
- package/dist/components/Button/index.d.ts +2 -1
- package/dist/components/Button/index.js +47 -22
- package/dist/components/CDPReactProvider/index.d.ts +3 -0
- package/dist/components/CDPReactProvider/index.js +20 -13
- package/dist/components/EmailForm/index.d.ts +11 -0
- package/dist/components/EmailForm/index.js +56 -0
- package/dist/components/Error/index.d.ts +2 -2
- package/dist/components/Error/index.js +11 -11
- package/dist/components/Field/index.d.ts +2 -1
- package/dist/components/Field/index.js +20 -18
- package/dist/components/FlowEmailOTP/index.d.ts +18 -0
- package/dist/components/FlowEmailOTP/index.js +70 -0
- package/dist/components/FlowPhoneNumberOTP/index.d.ts +18 -0
- package/dist/components/FlowPhoneNumberOTP/index.js +75 -0
- package/dist/components/Label/index.d.ts +7 -0
- package/dist/components/Label/index.js +13 -0
- package/dist/components/OTP/index.d.ts +3 -0
- package/dist/components/OTP/index.js +48 -33
- package/dist/components/OTPForm/index.d.ts +16 -0
- package/dist/components/OTPForm/index.js +76 -0
- package/dist/components/PhoneNumberForm/index.d.ts +14 -0
- package/dist/components/PhoneNumberForm/index.js +68 -0
- package/dist/components/PhoneNumberInput/PhoneNumberMetadata.d.ts +2 -0
- package/dist/components/PhoneNumberInput/PhoneNumberMetadata.js +5 -0
- package/dist/components/PhoneNumberInput/index.d.ts +10 -0
- package/dist/components/PhoneNumberInput/index.js +76 -0
- package/dist/components/PhoneNumberInput/maskOverride.d.ts +8 -0
- package/dist/components/PhoneNumberInput/maskOverride.js +61 -0
- package/dist/components/PhoneNumberInput/usePhoneNumberFormatter.d.ts +7 -0
- package/dist/components/PhoneNumberInput/usePhoneNumberFormatter.js +52 -0
- package/dist/components/ServerError/index.js +4 -4
- package/dist/components/SignIn/SignInAuthMethodButtons.d.ts +13 -0
- package/dist/components/SignIn/SignInAuthMethodButtons.js +57 -0
- package/dist/components/SignIn/SignInBackButton.d.ts +9 -0
- package/dist/components/SignIn/SignInBackButton.js +38 -0
- package/dist/components/SignIn/SignInCredentials.d.ts +2 -0
- package/dist/components/SignIn/SignInCredentials.js +8 -0
- package/dist/components/SignIn/SignInDescription.d.ts +4 -3
- package/dist/components/SignIn/SignInDescription.js +16 -23
- package/dist/components/SignIn/SignInFooter.d.ts +2 -0
- package/dist/components/SignIn/SignInFooter.js +18 -0
- package/dist/components/SignIn/SignInForm.d.ts +12 -4
- package/dist/components/SignIn/SignInForm.js +25 -196
- package/dist/components/SignIn/SignInImage.d.ts +2 -2
- package/dist/components/SignIn/SignInImage.js +11 -14
- package/dist/components/SignIn/SignInProvider.d.ts +1 -1
- package/dist/components/SignIn/SignInProvider.js +24 -16
- package/dist/components/SignIn/SignInTitle.d.ts +4 -3
- package/dist/components/SignIn/SignInTitle.js +18 -13
- package/dist/components/SignIn/flows/SignInWithEmail.d.ts +5 -0
- package/dist/components/SignIn/flows/SignInWithEmail.js +71 -0
- package/dist/components/SignIn/flows/SignInWithSms.d.ts +5 -0
- package/dist/components/SignIn/flows/SignInWithSms.js +2994 -0
- package/dist/components/SignIn/hooks/useEmailForm.d.ts +13 -0
- package/dist/components/SignIn/hooks/useEmailForm.js +42 -0
- package/dist/components/SignIn/hooks/useOTPForm.d.ts +16 -0
- package/dist/components/SignIn/hooks/useOTPForm.js +59 -0
- package/dist/components/SignIn/hooks/usePhoneNumberForm.d.ts +13 -0
- package/dist/components/SignIn/hooks/usePhoneNumberForm.js +42 -0
- package/dist/components/SignIn/index.d.ts +5 -2
- package/dist/components/SignIn/index.js +42 -24
- package/dist/components/SignIn/types.d.ts +106 -0
- package/dist/components/SignIn/types.js +3 -0
- package/dist/components/SignIn/useSignInReducer.d.ts +1 -57
- package/dist/components/SignIn/useSignInReducer.js +62 -20
- package/dist/components/SignInModal/index.d.ts +2 -2
- package/dist/components/SignInModal/index.js +62 -43
- package/dist/components/SuccessMessage/index.d.ts +7 -0
- package/dist/components/SuccessMessage/index.js +16 -0
- package/dist/components/SwitchFadeTransition/index.d.ts +5 -0
- package/dist/components/SwitchFadeTransition/index.js +24 -0
- package/dist/components/SwitchSlideTransition/index.d.ts +7 -0
- package/dist/components/SwitchSlideTransition/index.js +27 -0
- package/dist/components/SwitchTransition/index.d.ts +25 -0
- package/dist/components/SwitchTransition/index.js +155 -0
- package/dist/data/countries.d.ts +12 -0
- package/dist/data/countries.js +25 -0
- package/dist/data/countryNames.d.ts +1 -0
- package/dist/data/countryNames.js +6 -0
- package/dist/hooks/usePhoneNumberValidators.d.ts +14 -0
- package/dist/hooks/usePhoneNumberValidators.js +36 -0
- package/dist/hooks/useTimer.d.ts +5 -0
- package/dist/hooks/useTimer.js +24 -0
- package/dist/icons/IconArrowLeft.d.ts +2 -0
- package/dist/icons/IconArrowLeft.js +14 -0
- package/dist/icons/IconCheckCircle.js +2 -3
- package/dist/icons/IconCoinbaseWordmark.js +5 -5
- package/dist/icons/IconEnvelope.d.ts +2 -0
- package/dist/icons/IconEnvelope.js +7 -0
- package/dist/icons/IconExclamationCircle.js +3 -4
- package/dist/icons/IconPhone.d.ts +2 -0
- package/dist/icons/IconPhone.js +7 -0
- package/dist/icons/IconXMark.js +6 -5
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +14 -8
- package/dist/index.js +66 -53
- package/dist/theme/theme.d.ts +11 -2
- package/dist/theme/tokens.d.ts +30 -6
- package/dist/theme/tokens.js +7 -3
- package/dist/utils/parseValuesFromPhoneNumber.d.ts +6 -0
- package/dist/utils/parseValuesFromPhoneNumber.js +16 -0
- package/dist/utils/validatePhoneNumber.d.ts +1 -0
- package/dist/utils/validatePhoneNumber.js +1 -0
- package/package.json +11 -7
package/dist/assets/Button.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Button-module__btn___Fx11X{--cdp-web-button-ring-color: transparent;--cdp-web-button-ring-width: 2px;--cdp-web-button-ring-inset-color: transparent;--cdp-web-button-ring-inset-width: 2px;box-sizing:border-box;box-shadow:inset 0 0 0 var(--cdp-web-button-ring-inset-width) var(--cdp-web-button-ring-inset-color),0 0 0 var(--cdp-web-button-ring-width) var(--cdp-web-button-ring-color);display:inline-flex;align-items:center;justify-content:center;gap:.5em;padding:1em;border-radius:9999em;border:0;background-color:transparent;color:var(--cdp-web-colors-page-text-default);font-size:
|
|
1
|
+
.Button-module__btn___Fx11X{--cdp-web-button-ring-color: transparent;--cdp-web-button-ring-width: 2px;--cdp-web-button-ring-inset-color: transparent;--cdp-web-button-ring-inset-width: 2px;box-sizing:border-box;box-shadow:inset 0 0 0 var(--cdp-web-button-ring-inset-width) var(--cdp-web-button-ring-inset-color),0 0 0 var(--cdp-web-button-ring-width) var(--cdp-web-button-ring-color);display:inline-flex;align-items:center;justify-content:center;gap:.5em;padding:1em;border-radius:9999em;border:0;background-color:transparent;color:var(--cdp-web-colors-page-text-default);font-size:var(--cdp-web-font-size-base);font-family:var(--cdp-web-font-family-sans);font-weight:500;line-height:1.5;text-decoration:none;cursor:pointer;transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none}.Button-module__size-lg___2sR8u{padding:1em}.Button-module__size-md___HBcrV{padding:.75em}.Button-module__size-sm___yph5g{padding:.5em}.Button-module__link-primary___wROmv,.Button-module__link-secondary___5VErP{padding:0 .25em}.Button-module__primary___s1sM6{background-color:var(--cdp-web-colors-cta-primary-bg-default);color:var(--cdp-web-colors-cta-primary-text-default)}.Button-module__primary___s1sM6:hover{background-color:var(--cdp-web-colors-cta-primary-bg-hover);color:var(--cdp-web-colors-cta-primary-text-hover)}.Button-module__primary___s1sM6:focus{outline:none}.Button-module__primary___s1sM6:focus-visible{--cdp-web-button-ring-color: var(--cdp-web-colors-cta-primary-border-focus);--cdp-web-button-ring-inset-color: var(--cdp-web-colors-page-bg-default);outline:none}.Button-module__secondary___R0waJ{background-color:var(--cdp-web-colors-cta-secondary-bg-default);color:var(--cdp-web-colors-cta-secondary-text-default)}.Button-module__secondary___R0waJ:hover{background-color:var(--cdp-web-colors-cta-secondary-bg-hover);color:var(--cdp-web-colors-cta-secondary-text-hover)}.Button-module__secondary___R0waJ:focus{outline:none}.Button-module__secondary___R0waJ:focus-visible{--cdp-web-button-ring-color: var(--cdp-web-colors-cta-secondary-border-focus);--cdp-web-button-ring-inset-color: var(--cdp-web-colors-page-bg-default);outline:none}.Button-module__link-primary___wROmv,.Button-module__transparent-primary___Ah0yM{background-color:transparent;color:var(--cdp-web-colors-link-primary-text-default)}.Button-module__link-primary___wROmv:hover,.Button-module__transparent-primary___Ah0yM:hover{color:var(--cdp-web-colors-link-primary-text-hover)}.Button-module__link-primary___wROmv:focus,.Button-module__transparent-primary___Ah0yM:focus{outline:none}.Button-module__link-primary___wROmv:focus-visible,.Button-module__transparent-primary___Ah0yM:focus-visible{--cdp-web-button-ring-color: var(--cdp-web-colors-link-primary-text-default);outline:none}.Button-module__link-secondary___5VErP,.Button-module__transparent-secondary___kk5sZ{background-color:transparent;color:var(--cdp-web-colors-link-secondary-text-default)}.Button-module__link-secondary___5VErP:hover,.Button-module__transparent-secondary___kk5sZ:hover{color:var(--cdp-web-colors-link-secondary-text-hover)}.Button-module__link-secondary___5VErP:focus,.Button-module__transparent-secondary___kk5sZ:focus{outline:none}.Button-module__link-secondary___5VErP:focus-visible,.Button-module__transparent-secondary___kk5sZ:focus-visible{--cdp-web-button-ring-color: var(--cdp-web-colors-link-secondary-text-default);outline:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.EmailForm-module__form___MD6xv{display:flex;flex-direction:column;gap:1em}.EmailForm-module__server-error___uRzUG{justify-content:center}
|
package/dist/assets/Error.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Error-module__error___mRFLG{color:var(--cdp-web-colors-fg-negative);line-height:1.25em;display:flex;align-items:center;gap:.25em;margin:0}.Error-module__error___mRFLG span{font-size:.875em}.Error-module__icon___web4F{width:
|
|
1
|
+
.Error-module__error___mRFLG{color:var(--cdp-web-colors-fg-negative);line-height:1.25em;font-family:var(--cdp-web-font-family-sans);font-size:var(--cdp-web-font-size-base);display:flex;align-items:center;gap:.25em;margin:0}.Error-module__error___mRFLG span{font-size:.875em}.Error-module__icon___web4F{width:auto;height:.875em;flex-grow:0;flex-shrink:0}
|
package/dist/assets/Field.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Field-module__field-wrapper___0p4i7{display:flex;flex-direction:column;
|
|
1
|
+
.Field-module__field-wrapper___0p4i7{display:flex;flex-direction:column;font-family:var(--cdp-web-font-family-sans);font-size:var(--cdp-web-font-size-base);gap:.25em}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.FlowEmailOTP-module__step-wrapper___Cdk60{display:flex;flex-direction:column}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.FlowPhoneNumberOTP-module__step-wrapper___TtbeW{display:flex;flex-direction:column}
|
package/dist/assets/Input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Input-module__input___WjT81{--cdp-web-input-ring-width: 1px;--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-default);box-sizing:border-box;font-size:
|
|
1
|
+
.Input-module__input___WjT81{--cdp-web-input-ring-width: 1px;--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-default);box-sizing:border-box;font-family:var(--cdp-web-font-family-sans);font-size:var(--cdp-web-font-size-base);line-height:1.5;padding:1em;border-radius:.5em;border:0;background-color:var(--cdp-web-colors-input-bg-default);box-shadow:0 0 0 var(--cdp-web-input-ring-width) var(--cdp-web-input-ring-color) inset;color:var(--cdp-web-colors-input-text-default);transition:box-shadow .15s ease-in-out;width:100%}.Input-module__input___WjT81::placeholder{color:var(--cdp-web-colors-input-placeholder-default)}.Input-module__input___WjT81:focus-visible{outline:none;--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-focus);--cdp-web-input-ring-width: 2px}.Input-module__input___WjT81[aria-invalid=true]{--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-error)}.Input-module__input___WjT81[data-success=true]{--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-success)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Label-module__label___RaRvM{font-size:.875em;line-height:1.43;font-weight:500;color:var(--cdp-web-colors-input-label-default)}
|
package/dist/assets/OTP.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.OTP-module__otp___EUcSo{--cdp-web-otp-input-width: 25
|
|
1
|
+
.OTP-module__otp___EUcSo{--cdp-web-otp-input-width: 25%;display:flex;flex-direction:column;gap:.25em}.OTP-module__group-container___rfrCo{display:flex;gap:.5em}.OTP-module__input-container___-yRBL{width:var(--cdp-web-otp-input-width)}.OTP-module__input___MEBPV{text-align:center}.OTP-module__label___71Oaw{margin:0 0 .43em}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.OTPForm-module__otp-form___jQN4H [data-part=input-group]{padding-bottom:1.5em}.OTPForm-module__otp-form___jQN4H [data-part=success],.OTPForm-module__otp-form___jQN4H [data-part=error]{margin-top:-1.5em}.OTPForm-module__form-footer___JhfLr{display:flex;flex-flow:column nowrap;align-items:stretch;justify-content:center;min-height:1.5em;padding-top:1.5em;padding-bottom:.5em}.OTPForm-module__server-state-wrapper___PS7UP{margin-top:-1.5em;min-height:1.5em;position:relative;top:-.25em}.OTPForm-module__loading-spinner___fJRqe{color:var(--cdp-web-colors-link-primary-text-default);display:block;margin:0 auto}.OTPForm-module__resend-wrapper___HeIR2{display:flex;align-items:center;justify-content:center;text-align:center;min-height:1.5em}.OTPForm-module__reset-timer___MEkQh{color:var(--cdp-web-colors-page-text-muted);font-weight:500;line-height:1em;min-height:1em;display:flex;align-items:center;justify-content:center}.OTPForm-module__reset-timer___MEkQh p{font-size:.875em;line-height:1;margin:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.PhoneNumberForm-module__form___xIcYN{display:flex;flex-direction:column;gap:1em}.PhoneNumberForm-module__server-error___-98Dt{justify-content:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.PhoneNumberInput-module__phone-number-input___c7QxX{--cdp-web-input-ring-width: 1px;--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-default);box-sizing:border-box;display:flex;align-items:stretch;font-family:var(--cdp-web-font-family-sans);font-size:var(--cdp-web-font-size-base);line-height:1.5;padding-left:1em;border-radius:.5em;border:0;background-color:var(--cdp-web-colors-input-bg-default);box-shadow:0 0 0 var(--cdp-web-input-ring-width) var(--cdp-web-input-ring-color) inset;color:var(--cdp-web-colors-input-text-default);transition:box-shadow .15s ease-in-out;width:100%}.PhoneNumberInput-module__phone-number-input___c7QxX.PhoneNumberInput-module__invalid___qs2M2,.PhoneNumberInput-module__phone-number-input___c7QxX:focus-within.PhoneNumberInput-module__invalid___qs2M2{--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-error)}.PhoneNumberInput-module__phone-number-input___c7QxX.PhoneNumberInput-module__success___awnfm{--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-success)}.PhoneNumberInput-module__phone-number-input___c7QxX:focus-within{--cdp-web-input-ring-color: var(--cdp-web-colors-input-border-focus);--cdp-web-input-ring-width: 2px}.PhoneNumberInput-module__phone-number-input___c7QxX .PhoneNumberInput-module__input___ZkUYh{--cdp-web-input-ring-width: 0px;background-color:transparent;padding-left:.75em}.PhoneNumberInput-module__country-calling-code___xUjx5{display:flex;align-items:center;gap:.25rem}
|
package/dist/assets/SignIn.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignIn-module__sign-in___cYpee{border-radius:.75em;box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-sans);background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;
|
|
1
|
+
.SignIn-module__sign-in___cYpee{border-radius:.75em;box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-sans);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;padding:.75em 2em 1em;overflow:hidden;width:100%}.SignIn-module__title-desc-wrapper___VpPcA{display:flex;flex-direction:column;gap:1.5em;margin:1.5em 0}.SignIn-module__sign-in___cYpee *{box-sizing:border-box}.SignIn-module__back-button___bmE-y{align-self:flex-start}.SignIn-module__back-button-wrapper___Q9FA1{min-height:3em}.SignIn-module__footer___3Gkbc{margin-top:1.5em}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SignInAuthMethodButtons-module__auth-method-buttons___jYEH7{display:flex;flex-direction:column;gap:.5em}.SignInAuthMethodButtons-module__auth-btn-icon___VjvFY{flex-shrink:0;flex-grow:0;height:1.25em;padding-left:2em;width:auto}.SignInAuthMethodButtons-module__auth-btn-label___mEWd3{flex-grow:1;padding-right:2em}.SignInAuthMethodButtons-module__divider___zphEh{position:relative;text-align:center;margin:1em 0 .5em}.SignInAuthMethodButtons-module__divider___zphEh hr{border:0;border-top:1px solid var(--cdp-web-colors-page-border-default);margin:0;position:absolute;top:50%;left:0;right:0;transform:translateY(-50%)}.SignInAuthMethodButtons-module__divider___zphEh span{background-color:var(--cdp-web-colors-page-bg-default);text-transform:uppercase;font-weight:500;padding:0 .125em;position:relative}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SignInBackButton-module__icon___stNFS{width:1.5em;height:auto}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SignInCredentials-module__credentials___LE04y{font-weight:500;overflow-wrap:break-word;word-wrap:break-word}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInDescription-module__description___jZLc6{
|
|
1
|
+
.SignInDescription-module__description___jZLc6{text-align:center;margin:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SignInFooter-module__footer___DLNrl{color:var(--cdp-web-colors-page-text-muted);display:flex;align-items:center;justify-content:center;gap:.5em;line-height:1;padding:1em 2em 0}.SignInFooter-module__footer___DLNrl:first-child{border-top:0}.SignInFooter-module__footer___DLNrl p{display:flex;align-items:center;font-size:.75em;gap:.25em;margin:0}.SignInFooter-module__icon___hFhfx{height:auto;width:.75em}.SignInFooter-module__coinbase-icon___NeFOp{height:1em;width:auto}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInForm-
|
|
1
|
+
.SignInForm-module__auth-method-wrapper___uIOAB{display:flex;flex-direction:column;gap:1em}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInImage-module__logo___rlzt-{display:block;margin:0;width:
|
|
1
|
+
.SignInImage-module__logo___rlzt-{display:block;margin:0 auto;width:auto;height:64px;object-fit:cover}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInModal-module__trigger___IcJ8x{padding-left:2em;padding-right:2em}.SignInModal-module__modal___PErrT{--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);box-sizing:border-box;box-shadow:var(--shadow-md);width:100%;max-width:
|
|
1
|
+
.SignInModal-module__trigger___IcJ8x{padding-left:2em;padding-right:2em}.SignInModal-module__modal___PErrT{--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);box-sizing:border-box;box-shadow:var(--shadow-md);width:100%;max-width:28.125em;min-width:0;background:var(--cdp-web-colors-page-bg-default);border-radius:.5em;outline:1px solid var(--cdp-web-colors-page-border-default);position:relative}.SignInModal-module__modal___PErrT[data-state=open]{animation:SignInModal-module__slide-in___eayZg .2s ease-out,SignInModal-module__fade-in___YW32x .2s ease-out}.SignInModal-module__modal___PErrT[data-state=closed]{animation:SignInModal-module__slide-out___fY2xG .2s ease-in,SignInModal-module__fade-out___WE6g4 .2s ease-in}.SignInModal-module__sign-in___n05-5{height:100%;overflow:hidden}.SignInModal-module__sign-in___n05-5.SignInModal-module__no-footer___meSt1{padding-bottom:2em}.SignInModal-module__title-desc-wrapper___--XLa{display:flex;flex-direction:column;gap:1.5em;margin:1.5em 0}.SignInModal-module__title-desc-wrapper___--XLa:first-child{margin-top:0}.SignInModal-module__sign-in-form___Jzx1-,.SignInModal-module__sign-in-form___Jzx1- form{flex-grow:1}.SignInModal-module__sign-in-image___DGg7B{flex-grow:1;margin:2em 0}.SignInModal-module__footer___6qEo2{margin-top:1.5em}.SignInModal-module__buttons___jhaVn{display:flex;justify-content:flex-end;align-items:center;margin-left:-.75em;margin-right:-.75em;width:calc(100% + 1.5em)}.SignInModal-module__back-button___nMh2-{margin-left:0;margin-right:auto}.SignInModal-module__close-icon___b-gMh{height:auto;width:1.5em}.SignInModal-module__overlay___-0rmi{background:var(--cdp-web-colors-bg-overlay);box-sizing:border-box;-webkit-backdrop-filter:blur(.5em);backdrop-filter:blur(.5em);display:grid;grid-template-rows:auto 1fr;inset:0;overflow-y:auto;place-items:end center;position:fixed;z-index:1000}.SignInModal-module__overlay___-0rmi[data-state=open]{animation:SignInModal-module__fade-in___YW32x .2s ease-out}.SignInModal-module__overlay___-0rmi[data-state=closed]{animation:SignInModal-module__fade-out___WE6g4 .2s ease-in}.SignInModal-module__spacer___x-lRH{height:1em}@keyframes SignInModal-module__fade-in___YW32x{0%{opacity:0}to{opacity:1}}@keyframes SignInModal-module__fade-out___WE6g4{0%{opacity:1}to{opacity:0}}@keyframes SignInModal-module__slide-in___eayZg{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes SignInModal-module__slide-out___fY2xG{0%{transform:translateY(0)}to{transform:translateY(100%)}}@media (min-width: 400px){.SignInModal-module__overlay___-0rmi{padding:.5rem}}@media (min-width: 450px){.SignInModal-module__overlay___-0rmi{place-items:center;padding:1rem;grid-template-rows:1fr}.SignInModal-module__modal___PErrT{height:auto}.SignInModal-module__spacer___x-lRH{display:none}.SignInModal-module__sign-in-image___DGg7B{flex-grow:0;margin:0}.SignInModal-module__sign-in-image___DGg7B:empty{display:none}@keyframes SignInModal-module__slide-in___eayZg{0%{transform:translateY(10%)}to{transform:translateY(0)}}@keyframes SignInModal-module__slide-out___fY2xG{0%{transform:translateY(0)}to{transform:translateY(10%)}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInTitle-module__heading___QJ071{font-size:1.
|
|
1
|
+
.SignInTitle-module__heading___QJ071{font-size:1.25em;font-weight:500;line-height:1.4;text-align:center;margin:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SuccessMessage-module__success___ifqoT{color:var(--cdp-web-colors-fg-positive);font-family:var(--cdp-web-font-family-sans);font-size:var(--cdp-web-font-size-base);line-height:1.25em;display:flex;align-items:center;gap:.25em;margin:0}.SuccessMessage-module__success___ifqoT span{font-size:.875em}.SuccessMessage-module__icon___ClY26{width:auto;height:.875em;flex-grow:0;flex-shrink:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SwitchFadeTransition-module__switch-fade-transition___0ACbj[data-transition=fade]{position:relative}.SwitchFadeTransition-module__switch-fade-transition___0ACbj [data-transition=fade][data-status]{transition:opacity var(--cdp-web-transition-timeout, .2s);width:100%}.SwitchFadeTransition-module__switch-fade-transition___0ACbj [data-transition=fade][data-status=preEnter]{opacity:0}.SwitchFadeTransition-module__switch-fade-transition___0ACbj [data-transition=fade][data-status=exiting],.SwitchFadeTransition-module__switch-fade-transition___0ACbj [data-transition=fade][data-status=exited]{opacity:0;position:absolute;top:0;left:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-left][data-status],.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-right][data-status]{width:100%;transition:opacity var(--cdp-web-transition-timeout, .2s),transform var(--cdp-web-transition-timeout, .2s)}.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-left],.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-right],.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-left][data-animate-height=true]>div,.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-right][data-animate-height=true]>div{display:flex;position:relative;width:100%}.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-left][data-animate-height=true]>div,.SwitchSlideTransition-module__switch-slide-transition___iPQKq[data-transition=slide-right][data-animate-height=true]>div{align-items:flex-start}.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-left][data-status=preEnter]{opacity:0;transform:translate(200%)}.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-left][data-status=exiting],.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-left][data-status=exited]{position:absolute;opacity:0;transform:translate(-200%)}.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-right][data-status=preEnter]{opacity:0;transform:translate(-200%)}.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-right][data-status=exiting],.SwitchSlideTransition-module__switch-slide-transition___iPQKq [data-transition=slide-right][data-status=exited]{position:absolute;opacity:0;transform:translate(200%)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SwitchTransition-module__transition-wrapper___UekKW[data-animate-height=true]{--cdp-web-transition-height: min-cotent;height:var(--cdp-web-transition-height);transition:height var(--cdp-web-transition-timeout, .2s) ease-in-out}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ThemeProvider-module__wrapper___aXwhZ{width:100%}
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";.ThemeProvider-module__wrapper___aXwhZ{width:100%}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../components/CDPReactProvider/index.js";
|
|
2
|
+
import { config as o } from "../components/SignIn/flows/SignInWithEmail.js";
|
|
3
|
+
import { config as i } from "../components/SignIn/flows/SignInWithSms.js";
|
|
4
|
+
import "@coinbase/cdp-hooks";
|
|
5
|
+
import "react";
|
|
6
|
+
const a = {
|
|
7
|
+
email: o,
|
|
8
|
+
sms: i
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
a
|
|
12
|
+
};
|
|
@@ -7,7 +7,7 @@ import { SignOutButton as A } from "../SignOutButton/index.js";
|
|
|
7
7
|
import '../../assets/AuthButton.css';const B = "AuthButton-module__loading___JpDqi", D = {
|
|
8
8
|
loading: B
|
|
9
9
|
}, L = ({
|
|
10
|
-
closeOnSuccessDelay: S =
|
|
10
|
+
closeOnSuccessDelay: S = 800,
|
|
11
11
|
onSignInSuccess: g,
|
|
12
12
|
onSignInSuccessTransitionEnd: a,
|
|
13
13
|
onSignOutSuccess: h,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ButtonVariant } from '../../theme/theme';
|
|
2
|
+
import { ButtonSize, ButtonVariant } from '../../theme/theme';
|
|
3
3
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
isPending?: boolean;
|
|
5
5
|
pendingLabel?: ReactNode;
|
|
6
|
+
size?: ButtonSize;
|
|
6
7
|
variant?: ButtonVariant;
|
|
7
8
|
}
|
|
8
9
|
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,27 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p, useMemo as s } from "react";
|
|
3
3
|
import "../../theme/theme.js";
|
|
4
|
-
import { LoadingSpinner as
|
|
5
|
-
import { VisuallyHidden as
|
|
6
|
-
import '../../assets/Button.css';const
|
|
7
|
-
btn:
|
|
4
|
+
import { LoadingSpinner as B } from "../LoadingSpinner/index.js";
|
|
5
|
+
import { VisuallyHidden as k } from "../VisuallyHidden/index.js";
|
|
6
|
+
import '../../assets/Button.css';const g = "Button-module__btn___Fx11X", z = "Button-module__primary___s1sM6", f = "Button-module__secondary___R0waJ", r = {
|
|
7
|
+
btn: g,
|
|
8
|
+
"size-lg": "Button-module__size-lg___2sR8u",
|
|
9
|
+
"size-md": "Button-module__size-md___HBcrV",
|
|
10
|
+
"size-sm": "Button-module__size-sm___yph5g",
|
|
8
11
|
"link-primary": "Button-module__link-primary___wROmv",
|
|
9
12
|
"link-secondary": "Button-module__link-secondary___5VErP",
|
|
10
|
-
primary:
|
|
13
|
+
primary: z,
|
|
11
14
|
secondary: f,
|
|
12
15
|
"transparent-primary": "Button-module__transparent-primary___Ah0yM",
|
|
13
16
|
"transparent-secondary": "Button-module__transparent-secondary___kk5sZ"
|
|
14
|
-
}, h =
|
|
17
|
+
}, h = p(
|
|
15
18
|
({
|
|
16
|
-
children:
|
|
17
|
-
className:
|
|
18
|
-
isPending:
|
|
19
|
-
pendingLabel:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
children: a,
|
|
20
|
+
className: o = "",
|
|
21
|
+
isPending: i,
|
|
22
|
+
pendingLabel: m = "Loading...",
|
|
23
|
+
size: t = "lg",
|
|
24
|
+
variant: n = "primary",
|
|
25
|
+
..._
|
|
26
|
+
}, u) => {
|
|
27
|
+
const d = s(() => {
|
|
28
|
+
if (n === "linkPrimary" || n === "linkSecondary")
|
|
29
|
+
return "";
|
|
30
|
+
switch (t) {
|
|
31
|
+
case "lg":
|
|
32
|
+
return r["size-lg"];
|
|
33
|
+
case "md":
|
|
34
|
+
return r["size-md"];
|
|
35
|
+
case "sm":
|
|
36
|
+
return r["size-sm"];
|
|
37
|
+
default:
|
|
38
|
+
return r["size-lg"];
|
|
39
|
+
}
|
|
40
|
+
}, [t, n]), l = s(() => {
|
|
41
|
+
switch (n) {
|
|
25
42
|
case "primary":
|
|
26
43
|
return r.primary;
|
|
27
44
|
case "secondary":
|
|
@@ -37,11 +54,19 @@ import '../../assets/Button.css';const k = "Button-module__btn___Fx11X", B = "Bu
|
|
|
37
54
|
default:
|
|
38
55
|
return r.primary;
|
|
39
56
|
}
|
|
40
|
-
}, [
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
}, [n]);
|
|
58
|
+
return /* @__PURE__ */ e(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
className: `${r.btn} ${d} ${l} ${o}`,
|
|
62
|
+
ref: u,
|
|
63
|
+
..._,
|
|
64
|
+
children: i ? /* @__PURE__ */ c(y, { children: [
|
|
65
|
+
/* @__PURE__ */ e(B, { "aria-hidden": "true" }),
|
|
66
|
+
/* @__PURE__ */ e(k, { children: m })
|
|
67
|
+
] }) : a
|
|
68
|
+
}
|
|
69
|
+
);
|
|
45
70
|
}
|
|
46
71
|
);
|
|
47
72
|
h.displayName = "Button";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { CDPHooksProviderProps } from '@coinbase/cdp-hooks';
|
|
2
2
|
import { ThemeProviderProps } from '../ThemeProvider';
|
|
3
|
+
export declare const AUTH_METHODS: readonly ["email", "sms"];
|
|
4
|
+
export type AuthMethod = (typeof AUTH_METHODS)[number];
|
|
3
5
|
export interface AppConfig {
|
|
4
6
|
name: string;
|
|
5
7
|
logoUrl?: string;
|
|
6
8
|
showCoinbaseFooter?: boolean;
|
|
9
|
+
authMethods?: AuthMethod[];
|
|
7
10
|
}
|
|
8
11
|
export type CDPReactProviderProps = {
|
|
9
12
|
app?: AppConfig;
|
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { CDPContext as c, CDPHooksProvider as C } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { createContext as d, useContext as i, useMemo as
|
|
4
|
-
import { ThemeProvider as
|
|
5
|
-
const
|
|
6
|
-
|
|
3
|
+
import { createContext as d, useContext as i, useMemo as m } from "react";
|
|
4
|
+
import { ThemeProvider as u } from "../ThemeProvider/index.js";
|
|
5
|
+
const A = [
|
|
6
|
+
/** Email OTP method */
|
|
7
|
+
"email",
|
|
8
|
+
/** SMS OTP method */
|
|
9
|
+
"sms"
|
|
10
|
+
], g = ({ children: o, config: e, theme: r, app: p }) => {
|
|
11
|
+
const n = /* @__PURE__ */ t(f, { app: p, children: /* @__PURE__ */ t(u, { theme: r, children: o }) });
|
|
7
12
|
return i(c) ? n : /* @__PURE__ */ t(C, { config: e, children: n });
|
|
8
|
-
},
|
|
13
|
+
}, s = d(void 0), a = {
|
|
9
14
|
name: "",
|
|
10
15
|
logoUrl: "",
|
|
11
|
-
showCoinbaseFooter: !0
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
showCoinbaseFooter: !0,
|
|
17
|
+
authMethods: ["email"]
|
|
18
|
+
}, f = ({ children: o, app: e }) => {
|
|
19
|
+
const r = m(
|
|
14
20
|
() => ({
|
|
15
21
|
app: {
|
|
16
|
-
...
|
|
22
|
+
...a,
|
|
17
23
|
...e
|
|
18
24
|
}
|
|
19
25
|
}),
|
|
20
26
|
[e]
|
|
21
27
|
);
|
|
22
|
-
return /* @__PURE__ */ t(
|
|
23
|
-
},
|
|
24
|
-
const o = i(
|
|
28
|
+
return /* @__PURE__ */ t(s.Provider, { value: r, children: o });
|
|
29
|
+
}, D = () => {
|
|
30
|
+
const o = i(s);
|
|
25
31
|
if (!o)
|
|
26
32
|
throw new Error("useAppConfig must be used within an AppConfigProvider");
|
|
27
33
|
return o.app;
|
|
28
34
|
};
|
|
29
35
|
export {
|
|
36
|
+
A as AUTH_METHODS,
|
|
30
37
|
g as CDPReactProvider,
|
|
31
|
-
|
|
38
|
+
D as useAppConfig
|
|
32
39
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { APIError } from '@coinbase/cdp-hooks';
|
|
2
|
+
import { FormHTMLAttributes } from 'react';
|
|
3
|
+
export interface EmailFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "children"> {
|
|
4
|
+
email?: string;
|
|
5
|
+
error?: string | APIError;
|
|
6
|
+
isPending?: boolean;
|
|
7
|
+
onClearServerErrors?: () => void;
|
|
8
|
+
onEmailChange?: (value: string) => void;
|
|
9
|
+
submitLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const EmailForm: ({ className, email, error, onEmailChange, isPending, submitLabel, ...props }: EmailFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "@coinbase/cdp-hooks";
|
|
3
|
+
import { Form as c, FormSubmit as v } from "@radix-ui/react-form";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Button as f } from "../Button/index.js";
|
|
6
|
+
import { Field as h } from "../Field/index.js";
|
|
7
|
+
import { withValidityState as _ } from "../Input/index.js";
|
|
8
|
+
import { ServerError as E } from "../ServerError/index.js";
|
|
9
|
+
import { isEmailInvalid as F } from "../../utils/isEmailInvalid.js";
|
|
10
|
+
import '../../assets/EmailForm.css';const x = "EmailForm-module__form___MD6xv", o = {
|
|
11
|
+
form: x,
|
|
12
|
+
"server-error": "EmailForm-module__server-error___uRzUG"
|
|
13
|
+
}, N = ({
|
|
14
|
+
className: a = "",
|
|
15
|
+
email: t,
|
|
16
|
+
error: e,
|
|
17
|
+
onEmailChange: m,
|
|
18
|
+
isPending: l,
|
|
19
|
+
submitLabel: s = "Continue",
|
|
20
|
+
...d
|
|
21
|
+
}) => {
|
|
22
|
+
const i = {
|
|
23
|
+
autoComplete: "email",
|
|
24
|
+
type: "email",
|
|
25
|
+
placeholder: "name@example.com",
|
|
26
|
+
required: !0
|
|
27
|
+
}, n = (p) => {
|
|
28
|
+
m?.(p.target.value?.trim());
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ u(c, { className: `${o.form} ${a}`, ...d, children: [
|
|
31
|
+
/* @__PURE__ */ r(
|
|
32
|
+
h,
|
|
33
|
+
{
|
|
34
|
+
label: "Email address",
|
|
35
|
+
name: "email",
|
|
36
|
+
validators: [
|
|
37
|
+
["valueMissing", "Email is required"],
|
|
38
|
+
["typeMismatch", "Use a valid email address"],
|
|
39
|
+
[F, "Use a valid email address"]
|
|
40
|
+
],
|
|
41
|
+
children: _(
|
|
42
|
+
m !== void 0 ? {
|
|
43
|
+
...i,
|
|
44
|
+
value: t,
|
|
45
|
+
onChange: n
|
|
46
|
+
} : i
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
e && /* @__PURE__ */ r(E, { error: e, className: o["server-error"] }),
|
|
51
|
+
/* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r(f, { type: "submit", isPending: l, children: s }) })
|
|
52
|
+
] });
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
N as EmailForm
|
|
56
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { IconExclamationCircle as
|
|
4
|
-
import '../../assets/Error.css';const
|
|
5
|
-
error:
|
|
6
|
-
icon:
|
|
7
|
-
},
|
|
8
|
-
({ children: e, id: s, className: c = "" },
|
|
9
|
-
/* @__PURE__ */ r(
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { IconExclamationCircle as a } from "../../icons/IconExclamationCircle.js";
|
|
4
|
+
import '../../assets/Error.css';const _ = "Error-module__error___mRFLG", l = "Error-module__icon___web4F", o = {
|
|
5
|
+
error: _,
|
|
6
|
+
icon: l
|
|
7
|
+
}, p = t(
|
|
8
|
+
({ children: e, id: s, className: c = "", ...m }, n) => /* @__PURE__ */ i("p", { id: s, className: `${o.error} ${c}`, ref: n, ...m, children: [
|
|
9
|
+
/* @__PURE__ */ r(a, { className: o.icon }),
|
|
10
10
|
/* @__PURE__ */ r("span", { children: e })
|
|
11
11
|
] })
|
|
12
12
|
);
|
|
13
|
-
|
|
13
|
+
p.displayName = "Error";
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
p as Error
|
|
16
16
|
};
|
|
@@ -3,9 +3,10 @@ import { CSSProperties, JSX, ReactNode } from 'react';
|
|
|
3
3
|
export interface FormFieldProps {
|
|
4
4
|
children?: FormValidityStateProps["children"];
|
|
5
5
|
className?: string;
|
|
6
|
+
inlineError?: string;
|
|
6
7
|
label: string;
|
|
7
8
|
name: string;
|
|
8
9
|
style?: CSSProperties;
|
|
9
10
|
validators?: [FormMessageProps["match"], ReactNode][];
|
|
10
11
|
}
|
|
11
|
-
export declare const Field: ({ children, className, label, name, style, validators, }: FormFieldProps) => JSX.Element;
|
|
12
|
+
export declare const Field: ({ children, className, inlineError, label, name, style, validators, }: FormFieldProps) => JSX.Element;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FormField as
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { FormField as F, FormLabel as f, FormValidityState as u, FormControl as C, FormMessage as d } from "@radix-ui/react-form";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Error as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
4
|
+
import { Error as o } from "../Error/index.js";
|
|
5
|
+
import { Label as _ } from "../Label/index.js";
|
|
6
|
+
import '../../assets/Field.css';const w = {
|
|
7
|
+
"field-wrapper": "Field-module__field-wrapper___0p4i7"
|
|
8
|
+
}, $ = ({
|
|
9
|
+
children: i,
|
|
10
|
+
className: t = "",
|
|
11
|
+
inlineError: l,
|
|
12
|
+
label: m,
|
|
13
|
+
name: a,
|
|
14
|
+
style: s,
|
|
15
|
+
validators: p
|
|
16
|
+
}) => /* @__PURE__ */ n(F, { name: a, className: `${t} ${w["field-wrapper"]}`, style: s, children: [
|
|
17
|
+
/* @__PURE__ */ r(f, { asChild: !0, children: /* @__PURE__ */ r(_, { children: m }) }),
|
|
18
|
+
/* @__PURE__ */ r(u, { children: (e) => i && /* @__PURE__ */ r(C, { asChild: !0, children: i(e) }) }),
|
|
19
|
+
p?.map(([e, h], c) => /* @__PURE__ */ r(d, { match: e, asChild: !0, children: /* @__PURE__ */ r(o, { children: h }) }, c)),
|
|
20
|
+
l && /* @__PURE__ */ r(d, { asChild: !0, children: /* @__PURE__ */ r(o, { children: l }) })
|
|
19
21
|
] });
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
$ as Field
|
|
22
24
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { EmailFormProps } from '../EmailForm/EmailForm';
|
|
3
|
+
import { OTPFormProps } from '../OTPForm/OTPForm';
|
|
4
|
+
import { SwitchSlideTransitionRef } from '../SwitchSlideTransition/SwitchSlideTransition';
|
|
5
|
+
export type Step = "email" | "otp";
|
|
6
|
+
export interface FlowEmailOTPProps extends Omit<EmailFormProps, "onSubmit">, Omit<OTPFormProps, "onSubmit"> {
|
|
7
|
+
animateHeight?: boolean;
|
|
8
|
+
children?: (props: {
|
|
9
|
+
step: Step;
|
|
10
|
+
Form: ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
onSubmitEmail: EmailFormProps["onSubmit"];
|
|
14
|
+
onSubmitOTP: OTPFormProps["onSubmit"];
|
|
15
|
+
step: Step;
|
|
16
|
+
transitionRef: Ref<SwitchSlideTransitionRef<Step>>;
|
|
17
|
+
}
|
|
18
|
+
export declare const FlowEmailOTP: ({ autoFocus, animateHeight, canResetOTP, className, children, email, error, isPending, successMessage, onEmailChange, onOTPChange, onResendOTP, onSubmitEmail, onSubmitOTP, otp, otpInputsRef, resendCountdown, step, transitionRef, }: FlowEmailOTPProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as r, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { EmailForm as x } from "../EmailForm/index.js";
|
|
4
|
+
import { OTPForm as P } from "../OTPForm/index.js";
|
|
5
|
+
import { SwitchSlideTransition as g } from "../SwitchSlideTransition/index.js";
|
|
6
|
+
import '../../assets/FlowEmailOTP.css';const j = {
|
|
7
|
+
"step-wrapper": "FlowEmailOTP-module__step-wrapper___Cdk60"
|
|
8
|
+
}, A = ({
|
|
9
|
+
autoFocus: n = !0,
|
|
10
|
+
animateHeight: a = !0,
|
|
11
|
+
canResetOTP: u,
|
|
12
|
+
className: e = "",
|
|
13
|
+
children: m,
|
|
14
|
+
email: s,
|
|
15
|
+
error: l,
|
|
16
|
+
isPending: p,
|
|
17
|
+
successMessage: d,
|
|
18
|
+
onEmailChange: f,
|
|
19
|
+
onOTPChange: c,
|
|
20
|
+
onResendOTP: w,
|
|
21
|
+
onSubmitEmail: F,
|
|
22
|
+
onSubmitOTP: _,
|
|
23
|
+
otp: h,
|
|
24
|
+
otpInputsRef: E,
|
|
25
|
+
resendCountdown: S,
|
|
26
|
+
step: o,
|
|
27
|
+
transitionRef: T
|
|
28
|
+
}) => /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
|
|
29
|
+
g,
|
|
30
|
+
{
|
|
31
|
+
autoFocus: n,
|
|
32
|
+
animateHeight: a,
|
|
33
|
+
items: ["email", "otp"],
|
|
34
|
+
initialEntered: !0,
|
|
35
|
+
direction: o === "otp" ? "left" : "right",
|
|
36
|
+
transitionRef: T,
|
|
37
|
+
children: ({ itemKey: i, ...O }) => {
|
|
38
|
+
let t = null;
|
|
39
|
+
return i === "email" && (t = /* @__PURE__ */ r(
|
|
40
|
+
x,
|
|
41
|
+
{
|
|
42
|
+
className: e,
|
|
43
|
+
email: s,
|
|
44
|
+
error: o === "email" ? l : "",
|
|
45
|
+
isPending: p,
|
|
46
|
+
onEmailChange: f,
|
|
47
|
+
onSubmit: F
|
|
48
|
+
}
|
|
49
|
+
)), i === "otp" && (t = /* @__PURE__ */ r(
|
|
50
|
+
P,
|
|
51
|
+
{
|
|
52
|
+
canResetOTP: u,
|
|
53
|
+
className: e,
|
|
54
|
+
error: o === "otp" ? l : "",
|
|
55
|
+
isPending: p,
|
|
56
|
+
onOTPChange: c,
|
|
57
|
+
onResendOTP: w,
|
|
58
|
+
onSubmit: _,
|
|
59
|
+
otp: h,
|
|
60
|
+
otpInputsRef: E,
|
|
61
|
+
resendCountdown: S,
|
|
62
|
+
successMessage: d
|
|
63
|
+
}
|
|
64
|
+
)), /* @__PURE__ */ r("div", { ...O, className: j["step-wrapper"], children: m ? m({ step: i, Form: t }) : t });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
) });
|
|
68
|
+
export {
|
|
69
|
+
A as FlowEmailOTP
|
|
70
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { OTPFormProps } from '../OTPForm/OTPForm';
|
|
3
|
+
import { PhoneNumberFormProps } from '../PhoneNumberForm/PhoneNumberForm';
|
|
4
|
+
import { SwitchSlideTransitionRef } from '../SwitchSlideTransition/SwitchSlideTransition';
|
|
5
|
+
export type Step = "phoneNumber" | "otp";
|
|
6
|
+
export interface FlowPhoneNumberOTPProps extends Omit<PhoneNumberFormProps, "onSubmit">, Omit<OTPFormProps, "onSubmit"> {
|
|
7
|
+
animateHeight?: boolean;
|
|
8
|
+
children?: (props: {
|
|
9
|
+
step: Step;
|
|
10
|
+
Form: ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
onSubmitPhoneNumber: PhoneNumberFormProps["onSubmit"];
|
|
14
|
+
onSubmitOTP: OTPFormProps["onSubmit"];
|
|
15
|
+
step: Step;
|
|
16
|
+
transitionRef: Ref<SwitchSlideTransitionRef<Step>>;
|
|
17
|
+
}
|
|
18
|
+
export declare const FlowPhoneNumberOTP: ({ animateHeight, autoFocus, canResetOTP, children, className, countryCode, error, isPending, onCountryCodeChange, onOTPChange, onPhoneNumberChange, onResendOTP, onSubmitOTP, onSubmitPhoneNumber, otp, otpInputsRef, phoneNumber, resendCountdown, step, successMessage, transitionRef, }: FlowPhoneNumberOTPProps) => import("react/jsx-runtime").JSX.Element;
|