@dropins/storefront-auth 0.0.1-alpha9 → 1.0.0-beta2
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/api/confirmEmail/graphql/confirmEmail.graphql.d.ts +1 -1
- package/api/createCustomer/createCustomer.d.ts +3 -2
- package/api/createCustomer/graphql/createCustomer.graphql.d.ts +1 -1
- package/api/createCustomer/graphql/createCustomerV2.graphql.d.ts +1 -1
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +1 -1
- package/api/fragments.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +1 -1
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +1 -1
- package/api/getCustomerData/getCustomerData.d.ts +2 -2
- package/api/getCustomerData/graphql/getCustomerData.graphql.d.ts +1 -1
- package/api/getCustomerToken/getCustomerToken.d.ts +2 -2
- package/api/graphql/CustomerFragment.graphql.d.ts +2 -0
- package/api/initialize/initialize.d.ts +5 -1
- package/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.d.ts +1 -1
- package/api/resetPassword/graphql/resetPassword.graphql.d.ts +1 -1
- package/api.js +3 -1
- package/chunks/Button2.js +3 -0
- package/chunks/ResetPasswordForm.js +3 -1
- package/chunks/SignInForm.js +3 -1
- package/chunks/SignUpForm.js +3 -1
- package/chunks/SkeletonLoader.js +2 -0
- package/chunks/confirmEmail.js +5 -4
- package/chunks/createCustomerAddress.js +21 -15
- package/chunks/focusOnEmptyPasswordField.js +3 -0
- package/chunks/getCustomerToken.js +7 -6
- package/chunks/getStoreConfig.js +4 -2
- package/chunks/index.js +3 -1
- package/chunks/index2.js +3 -1
- package/chunks/index3.js +3 -1
- package/chunks/initialize.js +2 -0
- package/chunks/network-error.js +3 -1
- package/chunks/requestPasswordResetEmail.js +2 -0
- package/chunks/resendConfirmationEmail.js +6 -3
- package/chunks/resetPassword.js +12 -2
- package/chunks/revokeCustomerToken.js +2 -0
- package/chunks/setReCaptchaToken.js +3 -1
- package/chunks/simplifyTransformAttributesForm.js +3 -1
- package/chunks/transform-attributes-form.js +3 -1
- package/chunks/usePasswordValidationMessage.js +2 -0
- package/components/Form/Form.d.ts +4 -0
- package/components/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/index.d.ts +3 -4
- package/configs/defaultCreateUserConfigs.d.ts +42 -5
- package/containers/AuthCombine.js +3 -1
- package/containers/ResetPassword.js +3 -1
- package/containers/SignIn.js +3 -1
- package/containers/SignUp.js +3 -1
- package/containers/SuccessNotification.js +3 -1
- package/containers/UpdatePassword.js +3 -1
- package/data/models/attributes-form.d.ts +36 -16
- package/data/models/customer-data.d.ts +8 -3
- package/data/transforms/index.d.ts +1 -0
- package/data/transforms/transform-attributes-form.d.ts +3 -2
- package/data/transforms/transform-create-customer.d.ts +7 -0
- package/data/transforms/transform-customer-data.d.ts +2 -2
- package/fragments.d.ts +1 -0
- package/fragments.js +11 -0
- package/hooks/api/useGetAttributesForm.d.ts +1 -2
- package/hooks/{ui → components}/useForm.d.ts +3 -2
- package/hooks/components/useSignInForm.d.ts +5 -2
- package/hooks/components/useSignUpForm.d.ts +7 -1
- package/hooks/components/useUpdatePasswordForm.d.ts +5 -2
- package/hooks/useInLineAlert.d.ts +3 -3
- package/i18n/en_US.json.d.ts +32 -12
- package/lib/acdl.d.ts +2 -2
- package/lib/convertCase.d.ts +4 -0
- package/lib/focusOnEmptyPasswordField.d.ts +2 -0
- package/lib/initializeFormDataAndErrors.d.ts +10 -0
- package/lib/mergeFormObjects.d.ts +1 -2
- package/lib/simplifyTransformAttributesForm.d.ts +1 -1
- package/lib/validationFields.d.ts +33 -0
- package/package.json +1 -1
- package/render.js +4 -8
- package/types/api/createCustomer.types.d.ts +16 -11
- package/types/api/createCustomerAddress.types.d.ts +2 -2
- package/types/api/getAttributesForm.types.d.ts +5 -3
- package/types/api/getCustomerData.types.d.ts +1 -0
- package/types/emailConfirmationForm.types.d.ts +4 -4
- package/types/form.types.d.ts +24 -3
- package/types/notification.types.d.ts +5 -1
- package/types/resetPassword.types.d.ts +2 -2
- package/types/signIn.types.d.ts +4 -3
- package/types/signUp.types.d.ts +3 -2
- package/types/successNotification.types.d.ts +4 -2
- package/types/updatePassword.types.d.ts +4 -3
- package/chunks/EmailConfirmationForm.js +0 -1
- package/chunks/useInLineAlert.js +0 -1
- package/components/UI/Form/Form.d.ts +0 -5
- package/components/UI/FormInputs/FormInputs.d.ts +0 -13
- package/components/UI/Title/Title.d.ts +0 -11
- package/components/UI/Title/index.d.ts +0 -3
- package/components/UI/index.d.ts +0 -5
- /package/components/{UI/Button → Button}/Button.d.ts +0 -0
- /package/components/{UI/Button → Button}/index.d.ts +0 -0
- /package/components/{UI → Form}/FormInputs/index.d.ts +0 -0
- /package/components/{UI/Form → Form}/index.d.ts +0 -0
package/render.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.auth-resetPasswordForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-resetPasswordForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-resetPasswordForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-resetPasswordForm.small .auth-resetPasswordForm__form__item,.auth-resetPasswordForm.small .auth-resetPasswordForm__title{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__form{display:grid;grid-template-columns:1fr}.auth-resetPasswordForm__form__item{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}.auth-resetPasswordForm.small{grid-template-columns:1fr;gap:20px 0}.auth-resetPasswordForm__notification{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-resetPasswordForm__title{margin-bottom:var(--spacing-xxbig)}}
|
|
4
|
-
|
|
5
|
-
.auth-signInForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-signInForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-signInForm__notification{margin-bottom:var(--spacing-medium)}.auth-signInForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-signInForm.small .auth-signInForm__form__email,.auth-signInForm.small .auth-signInForm__form__password,.auth-signInForm.small .auth-signInForm__title{margin-bottom:var(--spacing-medium)}.auth-signInForm.small .auth-signInForm__form__buttons{grid-template-columns:1fr;gap:20px 0}.auth-signInForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-signInForm__title{margin-bottom:var(--spacing-xxbig)}}.auth-signInForm__form{display:grid;grid-template-columns:1fr}.auth-signInForm__form__email{margin-bottom:var(--spacing-medium)}.auth-signInForm__form__password{margin-bottom:var(--spacing-big)}.auth-signInForm__form__buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}@media (max-width: 768px){.auth-signInForm__form__buttons{gap:20px 0;grid-template-columns:1fr}}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{justify-content:center;flex-wrap:wrap}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine .auth-signInForm__button--signup{flex-basis:100%;margin-top:20px}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{display:none}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{display:flex}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{border:var(--shape-border-width-1) solid var(--color-brand-500);margin:13px 10px;font:var(--type-button-2-font)}.auth-signInForm__resend-email-notification button{font:var(--type-button-3-font);color:var(--textColor);display:inline;background-color:transparent;border:none;cursor:pointer;padding:0;margin:0}.auth-signInForm__resend-email-notification button:hover{color:var(--color-brand-700);text-decoration:solid underline var(--color-brand-700);text-underline-offset:6px;color:var(--color-informational-500)}@media (max-width: 768px){.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{justify-content:center;flex-wrap:wrap}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine .auth-signInForm__button--signup{flex-basis:100%;margin-top:20px}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{display:none}}
|
|
6
|
-
.auth-signUpForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-signUpForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-signUpForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-signUpForm.small .auth-signUpForm__title{margin-bottom:var(--spacing-small)}.auth-signUpForm.small .auth-signUpForm__form__item .auth-signUpForm__form__item--firstname,.auth-signUpForm.small .auth-signUpForm__form__item .auth-signUpForm__form__item--lastname{flex-basis:100%}.auth-signUpForm.small .auth-signUpForm__form{grid-template-columns:1fr}.auth-signUpForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-signUpForm__title{margin-bottom:var(--spacing-xxbig)}}.auth-signUpForm__notification{margin-bottom:var(--spacing-medium)}.auth-signUpForm__form{display:flex;flex-wrap:wrap;flex-direction:row;gap:0 13px}.auth-signUpForm__form__item{margin-bottom:var(--spacing-medium);flex-basis:100%;flex-grow:1;flex-shrink:0}.auth-signUpForm__checkbox{margin-bottom:12px}.auth-signUpForm__automatic-login{margin-top:12px}.auth-signUpForm__form__item--firstname,.auth-signUpForm__form__item--lastname{flex-shrink:1;flex-grow:1;flex-basis:100%}.auth-signUpForm-buttons{flex-basis:100%;display:grid;grid-template-columns:1fr;gap:var(--spacing-medium) 0;justify-content:center;grid-area:buttons}@media (min-width: 768px){.auth-signUpForm-buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}.auth-signUpForm__form__item--firstname,.auth-signUpForm__form__item--lastname{flex-shrink:1;flex-grow:.5;flex-basis:48%}}
|
|
7
|
-
.auth-button{position:relative}.auth-button__loader-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;display:none}.auth-custom-button__loader{width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;position:relative;animation:pulse 1s linear infinite}.auth-button__loader:after{content:"";position:absolute;width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%,-50%);animation:scaleUp 1s linear infinite}@keyframes scaleUp{0%{transform:translate(-50%,-50%) scale(0)}60%,to{transform:translate(-50%,-50%) scale(1)}}@keyframes pulse{0%,60%,to{transform:scale(1)}80%{transform:scale(1.2)}}.auth-button.enableLoader .auth-button__text{opacity:0}.auth-button.enableLoader .auth-button__loader-wrapper{opacity:1;display:inline-flex}.auth-title__heading{color:var(--color-neutral-800, #2b2b2b);font:var(--type-headline-2-default-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.auth-title__text{display:flex;justify-content:space-between;align-items:center}.auth-title__hr{margin-top:var(--spacing-xsmall);border:none;border-bottom:var(--shape-border-width-2) solid var(--color-neutral-400, #d6d6d6)}`,{styleId:"Auth"});
|
|
8
|
-
import{jsx as i}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as d,Render as u}from"@dropins/tools/lib.js";import{useState as m,useEffect as f}from"@dropins/tools/preact-hooks.js";import{UIProvider as g}from"@dropins/tools/components.js";import{events as y}from"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{c as p}from"./chunks/initialize.js";const h={PasswordValidationMessage:{chartTwoSymbols:"Use characters and numbers or symbols",chartThreeSymbols:"Use characters, numbers and symbols",chartFourSymbols:"Use uppercase characters, lowercase characters, numbers and symbols",messageLengthPassword:"At least {minLength} characters long"},ResetPasswordForm:{title:"Reset your password",buttonPrimary:"Reset password",buttonSecondary:"Back to sign in"},SignInForm:{title:"Sign in",buttonPrimary:"Sign in",buttonSecondary:"Sign up",buttonTertiary:"Forgot password?"},SignUpForm:{title:"Sign up",buttonPrimary:"Create account",buttonSecondary:"Already a member? Sign in",privacyPolicyDefaultText:"I’ve read and accept the Terms of Use and Privacy Policy.",subscribedDefaultText:"Subscribe to our newsletter and be the first to know about new arrivals, sales and exclusive offers.",keepMeLoggedText:"Keep me logged in after account creation",failedCreateCustomerAddress:"Failed to create customer addresses:"},UpdatePasswordForm:{title:"Update password",buttonPrimary:"Update password"},FormText:{requiredFieldError:"This is a required field."},EmailConfirmationForm:{title:"Verify your email address",subtitle:"We`ve sent an email to",mainText:"Check your inbox and click on the link we just send you to confirm your email address and activate your account.",buttonSecondary:"Resend email",buttonPrimary:"Close",accountConfirmMessage:"Account confirmed",accountConfirmationEmailSuccessMessage:"Congratulations! Your account at {email} email has been successfully confirmed."},Notification:{errorNotification:"Your password update failed due to validation errors. Please check your information and try again.",updatePasswordMessage:"The password has been updated. Now you can log in with the new password.",successPasswordResetEmailNotification:"If there is an account associated with {email} you will receive an email with a link to reset your password.",resendEmailNotification:{informationText:"This account is not confirmed.",buttonText:"Click here",additionalText:"to resend confirmation email."},emailConfirmationMessage:"Please check your email for confirmation link.",technicalErrors:{technicalErrorSendEmail:"A technical error occurred while trying to send the email. Please try again later."}},SuccessNotification:{headingText:"Welcome!",messageText:"We are glad to see you!",primaryButtonText:"Continue shopping",secondaryButtonText:"Logout"},Api:{customerTokenErrorMessage:"Unable to log in. Please try again later or contact support if the issue persists."}},b={Auth:h},w={default:b},S=({children:s})=>{var o,r;const[e,n]=m("en_US"),c=(r=(o=p)==null?void 0:o.getConfig())==null?void 0:r.langDefinitions;f(()=>{const t=y.on("locale",a=>{a!==e&&n(a)},{eager:!0});return()=>{t==null||t.off()}},[e]);const l=d(w,c??{});return i(g,{lang:e,langDefinitions:l,children:s})},F=new u(i(S,{}));export{F as render};
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
(function(o,t){try{if(typeof document<"u"){const a=document.createElement("style"),n=t.styleId;for(const i in t.attributes)a.setAttribute(i,t.attributes[i]);a.setAttribute("data-dropin",n),a.appendChild(document.createTextNode(o));const r=document.querySelector('style[data-dropin="sdk"]');if(r)r.after(a);else{const i=document.querySelector('link[rel="stylesheet"], style');i?i.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})('.auth-email-confirmation-form{border-radius:8px;background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small);text-align:start}@media (min-width: 768px){.auth-email-confirmation-form{padding:var(--spacing-big) var(--spacing-xbig) var(--spacing-xxbig) var(--spacing-xbig)}}.auth-email-confirmation-form__title{font:var(--type-headline-2-default-font);letter-spacing:var(--type-display-1-letter-spacing);color:var(--color-neutral-800, #3d3d3d)}.auth-email-confirmation-form__subtitle{display:block;font:var(--type-details-caption-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-neutral-700, #666666)}.auth-email-confirmation-form__notification{margin-bottom:var(--spacing-medium)}.auth-email-confirmation-form.auth-email-confirmation-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-email-confirmation-form.auth-email-confirmation-form--small .auth-email-confirmation-form__buttons{grid-template-columns:1fr;gap:20px 0}.auth-email-confirmation-form__buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}@media (max-width: 768px){.auth-email-confirmation-form__buttons{gap:20px 0;grid-template-columns:1fr}}.auth-email-confirmation-form__text{display:block;font-family:var(--type-body-1-default-font);letter-spacing:var(--type-display-1-letter-spacing);color:var(--neutrals-neutral-800);padding:var(--spacing-big) 0}.auth-email-confirmation-form.auth-email-confirmation-form--small .auth-email-confirmation-form__buttons{justify-content:center;flex-wrap:wrap}.auth-email-confirmation-form.auth-email-confirmation-form--small .auth-email-confirmation-form__buttons{flex-basis:100%;margin-top:var(--spacing-medium)}.auth-email-confirmation-form.auth-email-confirmation-form--small .auth-email-confirmation-form__buttons>span{display:none}.auth-email-confirmation-form__buttons>span{border:1px solid var(--color-brand-500);margin:var(--spacing-small) var(--spacing-xsmall);font:var(--type-button-2-font)}@media (max-width: 768px){.auth-email-confirmation-form__buttons{justify-content:center;flex-wrap:wrap}.auth-email-confirmation-form__buttons{flex-basis:100%;margin-top:var(--spacing-medium)}.auth-email-confirmation-form__buttons>span{display:none}}.auth-update-password-form{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-update-password-form{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-update-password-form.auth-update-password-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-update-password-form.auth-update-password-form--small .auth-update-password-form__form__item{margin-bottom:var(--spacing-big)}.auth-update-password-form.auth-update-password-form--small .auth-update-password-form__title{margin-bottom:var(--spacing-small)}.auth-update-password-form__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-update-password-form__title{margin-bottom:var(--spacing-xxbig)}}.auth-update-password-form__form .auth-update-password-form__form__item{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-update-password-form__form .auth-update-password-form__form__item{margin-bottom:var(--spacing-xxbig)}}.auth-update-password-form__notification{display:none}.auth-update-password-form__notification--show{display:grid;margin-bottom:var(--spacing-medium)}.auth-success-notification-form{display:flex;justify-content:center;align-items:center;flex-direction:column;border-radius:var(--shape-border-radius-2);background:var(--color-neutral-50, #fff);padding:var(--spacing-xbig) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-success-notification-form{padding:var(--spacing-big) var(--spacing-xbig) var(--spacing-xxbig) var(--spacing-xbig)}}.auth-success-notification-form.auth-success-notification-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-success-notification-form__title{color:var(--color-neutral-800, #2b2b2b);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-details-caption-1-letter-spacing);margin-bottom:var(--spacing-medium)}.auth-success-notification-form__content-text{color:var(--color-neutral-800, #2b2b2b);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);text-align:center;margin-bottom:var(--spacing-xxbig)}.auth-success-notification-form__button--top{margin-bottom:var(--spacing-xsmall)}.auth-sign-up-form{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-sign-up-form{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-sign-up-form.auth-sign-up-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-sign-up-form.auth-sign-up-form--small .auth-sign-up-form__title{margin-bottom:var(--spacing-small)}.auth-sign-up-form.auth-sign-up-form--small .auth-sign-up-form__form__field .auth-sign-up-form__form__field:nth-child(2),.auth-sign-up-form.auth-sign-up-form--small .auth-sign-up-form__form__field .auth-sign-up-form__form__field:nth-child(3){flex-basis:100%}.auth-sign-up-form.auth-sign-up-form--small .auth-sign-up-form__form{grid-template-columns:1fr}.auth-sign-up-form__form__confirm-wrapper>.auth-sign-up-form__form__field--confirm-password{margin:var(--spacing-medium) 0}.auth-sign-up-form__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-sign-up-form__title{margin-bottom:var(--spacing-xxbig)}}.auth-sign-up-form__notification{margin-bottom:var(--spacing-medium)}.auth-sign-up-form__form{display:flex;flex-wrap:wrap;flex-direction:row;gap:0 13px}.auth-sign-up-form__form__field{margin-bottom:var(--spacing-medium);flex-basis:100%;flex-grow:1;flex-shrink:0}.auth-sign-up-form__checkbox{margin-bottom:12px}.auth-sign-up-form__automatic-login{margin-top:12px}.auth-sign-up-form__form__field:nth-child(2),.auth-sign-up-form__form__field:nth-child(3){flex-shrink:1;flex-grow:1;flex-basis:100%}.auth-sign-up-form-buttons{flex-basis:100%;display:grid;grid-template-columns:1fr;gap:var(--spacing-medium) 0;justify-content:center;grid-area:buttons}@media (min-width: 768px){.auth-sign-up-form-buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}.auth-sign-up-form__form__field:nth-child(2),.auth-sign-up-form__form__field:nth-child(3){flex-shrink:1;flex-grow:.5;flex-basis:48%}}.auth-sign-in-form{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-sign-in-form{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-sign-in-form__notification{margin-bottom:var(--spacing-medium)}.auth-sign-in-form.auth-sign-in-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__email,.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__password,.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__title{margin-bottom:var(--spacing-medium)}.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__buttons{grid-template-columns:1fr;gap:20px 0}.auth-sign-in-form__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-sign-in-form__title{margin-bottom:var(--spacing-xxbig)}}.auth-sign-in-form__form{display:grid;grid-template-columns:1fr}.auth-sign-in-form__form__email{margin-bottom:var(--spacing-medium)}.auth-sign-in-form__form__password{margin-bottom:var(--spacing-big)}.auth-sign-in-form__form__buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}@media (max-width: 768px){.auth-sign-in-form__form__buttons{gap:20px 0;grid-template-columns:1fr}}.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine{justify-content:center;flex-wrap:wrap}.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine .auth-sign-in-form__button--signup{flex-basis:100%;margin-top:20px}.auth-sign-in-form.auth-sign-in-form--small .auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine>span{display:none}.auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine{display:flex}.auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine>span{border:var(--shape-border-width-1) solid var(--color-brand-500);margin:13px 10px;font:var(--type-button-2-font)}.auth-sign-in-form__resend-email-notification button{font:var(--type-button-3-font);color:var(--textColor);display:inline;background-color:transparent;border:none;cursor:pointer;padding:0;margin:0}.auth-sign-in-form__resend-email-notification button:hover{color:var(--color-brand-700);text-decoration:solid underline var(--color-brand-700);text-underline-offset:6px;color:var(--color-informational-500)}@media (max-width: 768px){.auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine{justify-content:center;flex-wrap:wrap}.auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine .auth-sign-in-form__button--signup{flex-basis:100%;margin-top:20px}.auth-sign-in-form__form__buttons .auth-sign-in-form__form__buttons__combine>span{display:none}}.auth-reset-password-form{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-reset-password-form{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-reset-password-form.auth-reset-password-form--small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-reset-password-form.auth-reset-password-form--small .auth-reset-password-form__form__item,.auth-reset-password-form.auth-reset-password-form--small .auth-reset-password-form__title{margin-bottom:var(--spacing-medium)}.auth-reset-password-form__form{display:grid;grid-template-columns:1fr}.auth-reset-password-form__form__item{margin-bottom:var(--spacing-medium)}.auth-reset-password-form__buttons{display:grid;grid-template-columns:1fr;gap:20px 0}.auth-reset-password-form.auth-reset-password-form--small{grid-template-columns:1fr;gap:20px 0}.auth-reset-password-form__notification{margin-bottom:var(--spacing-medium)}.auth-reset-password-form__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-reset-password-form__title{margin-bottom:var(--spacing-xxbig)}}@media (min-width: 600px){.auth-reset-password-form__buttons{grid-template-columns:auto auto;justify-content:space-between}}.auth-button{position:relative}.auth-button__wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;display:none}.auth-custom-button__loader{width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;position:relative;animation:pulse 1s linear infinite}.auth-button__loader:after{content:"";position:absolute;width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%,-50%);animation:scaleUp 1s linear infinite}@keyframes scaleUp{0%{transform:translate(-50%,-50%) scale(0)}60%,to{transform:translate(-50%,-50%) scale(1)}}@keyframes pulse{0%,60%,to{transform:scale(1)}80%{transform:scale(1.2)}}.auth-button.enableLoader .auth-button__text{opacity:0}.auth-button.enableLoader .auth-button__wrapper{opacity:1;display:inline-flex}',{styleId:"Auth"});
|
|
4
|
+
import{jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as d,Render as m}from"@dropins/tools/lib.js";import{useState as u,useEffect as f}from"@dropins/tools/preact-hooks.js";import{UIProvider as h}from"@dropins/tools/components.js";import{events as p}from"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{c as g}from"./chunks/initialize.js";const w={PasswordValidationMessage:{chartTwoSymbols:"Use characters and numbers or symbols",chartThreeSymbols:"Use characters, numbers and symbols",chartFourSymbols:"Use uppercase characters, lowercase characters, numbers and symbols",messageLengthPassword:"At least {minLength} characters long"},ResetPasswordForm:{title:"Reset your password",buttonPrimary:"Reset password",buttonSecondary:"Back to sign in",formAriaLabel:"Reset your password form"},SignInForm:{title:"Sign in",buttonPrimary:"Sign in",buttonSecondary:"Sign up",buttonTertiary:"Forgot password?"},SignUpForm:{title:"Sign up",buttonPrimary:"Create account",buttonSecondary:"Already a member? Sign in",privacyPolicyDefaultText:"I’ve read and accept the Terms of Use and Privacy Policy.",subscribedDefaultText:"Subscribe to our newsletter and be the first to know about new arrivals, sales and exclusive offers.",keepMeLoggedText:"Keep me logged in after account creation",failedCreateCustomerAddress:"Failed to create customer addresses:",confirmPassword:{placeholder:"Confirm password",floatingLabel:"Confirm password *",passwordMismatch:"Passwords do not match. Please make sure both password fields are identical."}},UpdatePasswordForm:{title:"Update password",buttonPrimary:"Update password"},FormText:{requiredFieldError:"This is a required field.",numericError:"Only numeric values are allowed.",alphaNumWithSpacesError:"Only alphanumeric characters and spaces are allowed.",alphaNumericError:"Only alphanumeric characters are allowed.",alphaError:"Only alphabetic characters are allowed.",emailError:"Please enter a valid email address.",dateError:"Please enter a valid date.",dateLengthError:"Date must be between {min} and {max}.",dateMaxError:"Date must be less than or equal to {max}.",dateMinError:"Date must be greater than or equal to {min}.",urlError:"Please enter a valid URL, e.g., https://www.website.com.",lengthTextError:"Text length must be between {min} and {max} characters."},EmailConfirmationForm:{title:"Verify your email address",subtitle:"We`ve sent an email to",mainText:"Check your inbox and click on the link we just send you to confirm your email address and activate your account.",buttonSecondary:"Resend email",buttonPrimary:"Close",accountConfirmMessage:"Account confirmed",accountConfirmationEmailSuccessMessage:"Congratulations! Your account at {email} email has been successfully confirmed."},Notification:{errorNotification:"Your password update failed due to validation errors. Please check your information and try again.",updatePasswordMessage:"The password has been updated.",updatePasswordActionMessage:"Sign in",successPasswordResetEmailNotification:"If there is an account associated with {email} you will receive an email with a link to reset your password.",resendEmailNotification:{informationText:"This account is not confirmed.",buttonText:"Resend confirmation email"},emailConfirmationMessage:"Please check your email for confirmation link.",technicalErrors:{technicalErrorSendEmail:"A technical error occurred while trying to send the email. Please try again later."}},SuccessNotification:{headingText:"Welcome!",messageText:"We are glad to see you!",primaryButtonText:"Continue shopping",secondaryButtonText:"Logout"},Api:{customerTokenErrorMessage:"Unable to log in. Please try again later or contact support if the issue persists."},InputPassword:{placeholder:"Password",floatingLabel:"Password *"}},b={Auth:w},y={default:b},P=({children:n})=>{var r,t;const[e,i]=u("en_US"),c=(t=(r=g)==null?void 0:r.getConfig())==null?void 0:t.langDefinitions;f(()=>{const a=p.on("locale",o=>{o!==e&&i(o)},{eager:!0});return()=>{a==null||a.off()}},[e]);const l=d(y,c??{});return s(h,{lang:e,langDefinitions:l,children:n})},k=new m(s(P,{}));export{k as render};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
+
type customAttributesProps = {
|
|
2
|
+
custom_attributes: Record<string, string>[];
|
|
3
|
+
};
|
|
4
|
+
type errorProps = {
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
1
7
|
export interface Customer {
|
|
2
8
|
firstname: string;
|
|
3
9
|
lastname: string;
|
|
4
10
|
email: string;
|
|
5
11
|
is_subscribed: boolean;
|
|
6
|
-
custom_attributes?: Record<string, string>[];
|
|
7
12
|
}
|
|
8
13
|
interface CreateCustomerResponse {
|
|
9
14
|
customer: Customer;
|
|
10
15
|
}
|
|
11
|
-
interface DataCreateCustomerV2 {
|
|
12
|
-
|
|
16
|
+
export interface DataCreateCustomerV2 {
|
|
17
|
+
data: {
|
|
18
|
+
createCustomerV2: CreateCustomerResponse & customAttributesProps;
|
|
19
|
+
};
|
|
20
|
+
errors?: errorProps[];
|
|
13
21
|
}
|
|
14
|
-
interface DataCreateCustomer {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
errors?: {
|
|
20
|
-
message: string;
|
|
21
|
-
}[];
|
|
22
|
+
export interface DataCreateCustomer {
|
|
23
|
+
data: {
|
|
24
|
+
createCustomer: CreateCustomerResponse;
|
|
25
|
+
};
|
|
26
|
+
errors?: errorProps[];
|
|
22
27
|
}
|
|
23
28
|
export {};
|
|
24
29
|
//# sourceMappingURL=createCustomer.types.d.ts.map
|
|
@@ -28,8 +28,8 @@ export interface AddressFormProps {
|
|
|
28
28
|
company: string;
|
|
29
29
|
country_code: string;
|
|
30
30
|
country_id: string;
|
|
31
|
-
custom_attributes
|
|
32
|
-
custom_attributesV2
|
|
31
|
+
custom_attributes?: CustomAttributes[];
|
|
32
|
+
custom_attributesV2?: CustomAttributesV2[];
|
|
33
33
|
default_billing?: boolean;
|
|
34
34
|
default_shipping?: boolean;
|
|
35
35
|
fax: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ResponseAttributesFormItemsProps {
|
|
2
2
|
code: string;
|
|
3
|
+
sort_order: string;
|
|
3
4
|
default_value: null | string;
|
|
4
5
|
entity_type: string;
|
|
5
6
|
frontend_class: null | string;
|
|
7
|
+
multiline_count: number;
|
|
6
8
|
frontend_input: string;
|
|
7
9
|
is_required: boolean;
|
|
8
10
|
is_unique: boolean;
|
|
@@ -13,13 +15,13 @@ export interface getAttributesFormItems {
|
|
|
13
15
|
value: string;
|
|
14
16
|
}[];
|
|
15
17
|
}
|
|
16
|
-
export interface
|
|
18
|
+
export interface GetAttributesFormResponse {
|
|
17
19
|
data: {
|
|
18
20
|
attributesForm: {
|
|
19
21
|
errors?: {
|
|
20
22
|
message: string;
|
|
21
23
|
}[];
|
|
22
|
-
items?:
|
|
24
|
+
items?: ResponseAttributesFormItemsProps[];
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
errors?: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InLineAlertInterface } from './notification.types';
|
|
2
2
|
|
|
3
3
|
export interface EmailConfirmationFormProps {
|
|
4
4
|
userEmail: string;
|
|
5
5
|
formSize: 'default' | 'small';
|
|
6
|
-
inLineAlertProps:
|
|
6
|
+
inLineAlertProps: InLineAlertInterface;
|
|
7
7
|
hideCloseBtnOnEmailConfirmation?: boolean;
|
|
8
|
-
handleSetInLineAlertProps: (value:
|
|
8
|
+
handleSetInLineAlertProps: (value: InLineAlertInterface) => void;
|
|
9
9
|
onPrimaryButtonClick: () => void;
|
|
10
10
|
}
|
|
11
11
|
export interface useEmailConfirmationFormProps extends Omit<EmailConfirmationFormProps, 'formSize' | 'inLineAlertProps' | 'onPrimaryButtonClick'> {
|
|
12
|
-
handleSetInLineAlertProps: (value:
|
|
12
|
+
handleSetInLineAlertProps: (value: InLineAlertInterface) => void;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=emailConfirmationForm.types.d.ts.map
|
package/types/form.types.d.ts
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
+
import { AttributesFormItemsProps, FieldEnumList } from '../data/models';
|
|
2
|
+
|
|
1
3
|
export interface FormProps {
|
|
2
4
|
fieldsConfig?: any;
|
|
3
5
|
name?: string;
|
|
4
6
|
className?: string;
|
|
5
7
|
children?: any;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
loading: boolean;
|
|
9
|
+
onSubmit?: (event: SubmitEvent, isValid: boolean) => Promise<void | null | undefined>;
|
|
8
10
|
}
|
|
9
|
-
export interface useFormProps extends Omit<FormProps, 'children' | 'className' | 'name'> {
|
|
11
|
+
export interface useFormProps extends Omit<FormProps, 'children' | 'className' | 'name' | 'loading'> {
|
|
12
|
+
}
|
|
13
|
+
export interface FormInputsProps {
|
|
14
|
+
className?: string;
|
|
15
|
+
errors?: Record<string, string>;
|
|
16
|
+
values?: Record<string, string | number | boolean>;
|
|
17
|
+
fields?: any;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
onChange?: (event: Event) => void;
|
|
20
|
+
onBlur?: (event: Event) => void;
|
|
21
|
+
onFocus?: (event: Event) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface FieldsProps extends Omit<AttributesFormItemsProps, 'options'> {
|
|
24
|
+
className: string;
|
|
25
|
+
fieldType: FieldEnumList;
|
|
26
|
+
id: string;
|
|
27
|
+
options: {
|
|
28
|
+
value: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
10
31
|
}
|
|
11
32
|
//# sourceMappingURL=form.types.d.ts.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { VNode } from 'preact';
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type AdditionalActionsAlertProps = Array<{
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: (event: Event) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export interface InLineAlertInterface {
|
|
5
9
|
type?: 'success' | 'warning' | 'error';
|
|
6
10
|
text?: string;
|
|
7
11
|
icon?: VNode<HTMLAttributes<SVGSVGElement>> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { activeComponentType } from './authCombine.types';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
|
|
4
4
|
export interface ResetPasswordProps {
|
|
5
5
|
formSize?: 'default' | 'small';
|
|
@@ -10,6 +10,6 @@ export interface ResetPasswordFormProps extends ResetPasswordProps {
|
|
|
10
10
|
setActiveComponent?: (componentName: activeComponentType) => void;
|
|
11
11
|
}
|
|
12
12
|
export interface UseResetPasswordFormProps extends Omit<ResetPasswordFormProps, 'formSize'> {
|
|
13
|
-
handleSetInLineAlertProps?: (value?:
|
|
13
|
+
handleSetInLineAlertProps?: (value?: InLineAlertInterface) => void;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=resetPassword.types.d.ts.map
|
package/types/signIn.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
2
|
import { activeComponentType } from './authCombine.types';
|
|
3
|
-
import {
|
|
3
|
+
import { InLineAlertInterface } from './notification.types';
|
|
4
4
|
|
|
5
5
|
type DefaultSlotContext = {
|
|
6
6
|
isSuccessful: {
|
|
@@ -12,6 +12,7 @@ export interface SignInProps {
|
|
|
12
12
|
slots?: {
|
|
13
13
|
SuccessNotification?: SlotProps<DefaultSlotContext>;
|
|
14
14
|
};
|
|
15
|
+
labels?: Record<string, string>;
|
|
15
16
|
formSize?: 'default' | 'small';
|
|
16
17
|
renderSignUpLink?: boolean;
|
|
17
18
|
initialEmailValue?: string;
|
|
@@ -32,12 +33,12 @@ export interface SignInFormProps extends SignInProps {
|
|
|
32
33
|
setActiveComponent?: (componentName: activeComponentType) => void;
|
|
33
34
|
}
|
|
34
35
|
export interface useSignInFormProps extends Omit<SignInFormProps, 'formSize' | 'slots'> {
|
|
35
|
-
handleSetInLineAlertProps: (value?:
|
|
36
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
36
37
|
emailConfirmationStatusMessage?: {
|
|
37
38
|
text: string;
|
|
38
39
|
status: '' | 'success' | 'error';
|
|
39
40
|
};
|
|
40
|
-
translations:
|
|
41
|
+
translations: Record<string, string>;
|
|
41
42
|
}
|
|
42
43
|
export {};
|
|
43
44
|
//# sourceMappingURL=signIn.types.d.ts.map
|
package/types/signUp.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { activeComponentType } from './authCombine.types';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
import { AddressFormProps } from './api/createCustomerAddress.types';
|
|
4
4
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
5
5
|
|
|
@@ -14,6 +14,7 @@ type DefaultSlotContext = {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
export interface SignUpProps {
|
|
17
|
+
requireRetypePassword?: boolean;
|
|
17
18
|
addressesData?: AddressFormProps[];
|
|
18
19
|
inputsDefaultValueSet?: inputsDefaultValueSetProps[];
|
|
19
20
|
fieldsConfigForApiVersion1?: any;
|
|
@@ -43,7 +44,7 @@ export interface UseSingUpFormProps extends Omit<SignUpFormProps, 'formSize' | '
|
|
|
43
44
|
minLength: number;
|
|
44
45
|
requiredCharacterClasses: number;
|
|
45
46
|
} | null;
|
|
46
|
-
handleSetInLineAlertProps: (value?:
|
|
47
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
47
48
|
isEmailConfirmationRequired?: boolean;
|
|
48
49
|
translations: Record<string, string>;
|
|
49
50
|
}
|
|
@@ -6,8 +6,10 @@ export interface SuccessNotificationProps {
|
|
|
6
6
|
};
|
|
7
7
|
formSize?: 'default' | 'small';
|
|
8
8
|
className?: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
labels?: {
|
|
10
|
+
headingText: string;
|
|
11
|
+
messageText: string;
|
|
12
|
+
};
|
|
11
13
|
}
|
|
12
14
|
export interface SuccessNotificationFormProps extends SuccessNotificationProps {
|
|
13
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
|
|
4
4
|
type DefaultSlotContext = {
|
|
5
5
|
isSuccessful: {
|
|
@@ -12,9 +12,10 @@ export interface UpdatePasswordProps {
|
|
|
12
12
|
formSize?: 'default' | 'small';
|
|
13
13
|
routeRedirectOnPasswordUpdate?: () => string;
|
|
14
14
|
routeRedirectOnSignIn?: () => string;
|
|
15
|
+
routeSignInPage?: () => string;
|
|
15
16
|
routeWrongUrlRedirect?: () => string;
|
|
16
17
|
onErrorCallback?: (value: unknown) => void;
|
|
17
|
-
onSuccessCallback?: (value
|
|
18
|
+
onSuccessCallback?: (value?: string) => void;
|
|
18
19
|
slots?: {
|
|
19
20
|
SuccessNotification?: SlotProps<DefaultSlotContext>;
|
|
20
21
|
};
|
|
@@ -27,7 +28,7 @@ export interface UseUpdatePasswordFormProps extends Omit<UpdatePasswordFormProps
|
|
|
27
28
|
minLength: number;
|
|
28
29
|
requiredCharacterClasses: number;
|
|
29
30
|
} | null;
|
|
30
|
-
handleSetInLineAlertProps: (value?:
|
|
31
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
31
32
|
}
|
|
32
33
|
export {};
|
|
33
34
|
//# sourceMappingURL=updatePassword.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as c,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b}from"@dropins/tools/lib.js";import{InLineAlert as C}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{r as y}from"./resendConfirmationEmail.js";import{useState as x,useCallback as E}from"@dropins/tools/preact-hooks.js";import{useText as u}from"@dropins/tools/i18n.js";import{T as F,B as f}from"./useInLineAlert.js";const p=({userEmail:e,handleSetInLineAlertProps:a})=>{const i=u({emailConfirmationMessage:"Auth.Notification.emailConfirmationMessage",technicalErrorSendEmail:"Auth.Notification.technicalErrors.technicalErrorSendEmail"}),[l,r]=x(!1);return{handleEmailConfirmation:E(async()=>{var o,m;if(r(!0),e){const t=await y(e);if(t){const d=(o=t==null?void 0:t.errors)==null?void 0:o.length,h=(m=t==null?void 0:t.data)==null?void 0:m.resendConfirmationEmail;a(d?{type:"error",text:i.technicalErrorSendEmail}:{type:h?"success":"error",text:i.emailConfirmationMessage})}}r(!1)},[a,i,e]),disabledButton:l}},M=({formSize:e,userEmail:a,inLineAlertProps:i,hideCloseBtnOnEmailConfirmation:l,handleSetInLineAlertProps:r,onPrimaryButtonClick:s})=>{const o=u({title:"Auth.EmailConfirmationForm.title",subtitle:"Auth.EmailConfirmationForm.subtitle",mainText:"Auth.EmailConfirmationForm.mainText",buttonPrimary:"Auth.EmailConfirmationForm.buttonPrimary",buttonSecondary:"Auth.EmailConfirmationForm.buttonSecondary"}),{handleEmailConfirmation:m,disabledButton:t}=p({userEmail:a,handleSetInLineAlertProps:r});return c("div",{className:b(["auth-emailConfirmationForm",e]),children:[i.text?n(C,{className:"auth-signInForm__notification",type:i.type,variant:"secondary",heading:i.text,icon:i.icon,"data-testid":"authInLineAlert"}):null,n(F,{text:o.title,bottomLine:!1,className:"auth-emailConfirmationForm__title"}),a!=null&&a.length?n("span",{className:"auth-emailConfirmationForm__subtitle",children:`${o.subtitle} ${a}`}):null,n("span",{className:"auth-emailConfirmationForm__text",children:o.mainText}),c("div",{className:"auth-emailConfirmationForm-buttons",children:[n(f,{type:"button",variant:"tertiary",style:{padding:0},buttonText:o.buttonSecondary,enableLoader:!1,onClick:m,disabled:t}),l?null:n(f,{type:"submit",buttonText:o.buttonPrimary,variant:"primary",enableLoader:!1,disabled:t,onClick:s})]})]})};export{M as E};
|
package/chunks/useInLineAlert.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as L,jsx as c,Fragment as V}from"@dropins/tools/preact-jsx-runtime.js";import{useCallback as m,useRef as M,useState as C,useEffect as F}from"@dropins/tools/preact-hooks.js";import{classes as k}from"@dropins/tools/lib.js";import{Button as S,Field as _,Picker as y,Input as T,InputDate as N,Checkbox as A,TextArea as D}from"@dropins/tools/components.js";import{initReCaptcha as H}from"@dropins/tools/recaptcha.js";import{useText as I}from"@dropins/tools/i18n.js";import*as h from"@dropins/tools/preact-compat.js";import{memo as q,useCallback as x}from"@dropins/tools/preact-compat.js";const ee=r=>{if(!r)return null;const o=new FormData(r);if(o&&typeof o.entries=="function"){const u=o.entries();if(u&&typeof u[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(u)))||{}}return{}},re=r=>typeof r=="function",te=({type:r,buttonText:o,variant:u,className:s="",enableLoader:l=!1,onClick:d,style:p,icon:n,...E})=>{const w=m(v=>{d==null||d(v)},[d]);return L(S,{icon:n,style:p,type:r,variant:u,className:k(["auth-button",s,l?"enableLoader":""]),onClick:w,...E,children:[c("span",{className:"auth-button__text",children:o}),l?c("div",{className:"auth-button__loader-wrapper",children:c("span",{className:"auth-button__loader"})}):null]})},O=r=>r.reduce((o,{code:u,required:s,defaultValue:l})=>(s&&(o[u]=l),o),{}),Z=({fieldsConfig:r,submitCallback:o})=>{const{requiredFieldError:u}=I({requiredFieldError:"Auth.FormText.requiredFieldError"}),s=M(null),[l,d]=C({}),[p,n]=C({});F(()=>{if(!r.length)return;const f=O(r);d(f)},[r==null?void 0:r.length]);const E=m((f,e)=>{const t=r.find(i=>i.code===f);return t!=null&&t.required&&!e?u:""},[r,u]),w=m(f=>{const{name:e,value:t,type:a,checked:i}=f==null?void 0:f.target,$=a==="checkbox"?i:t;d(g=>({...g,[e]:$}))},[]);F(()=>{H()},[]);const b=m(f=>{const{name:e,value:t,type:a,checked:i}=f==null?void 0:f.target,$=a==="checkbox"?i:t;n(g=>({...g,[e]:E(e,$)}))},[E]),v=m(f=>{f.preventDefault();let e=!0,t={},a=null;for(const[i,$]of Object.entries(l)){const g=E(i,$);g&&(t[i]=g,e=!1,a||(a=i))}if(n(t),a&&s.current){const i=s.current.elements.namedItem(a);i==null||i.focus()}o==null||o(f,e)},[l,E,o]);return{formData:l,errors:p,formRef:s,handleChange:w,handleBlur:b,handleSubmit:v}},R=r=>h.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.8052 14.4968C10.8552 14.4968 9.9752 14.0268 9.4452 13.2368L9.4152 13.1868L9.3852 13.1268C8.1352 11.2268 7.5352 8.96681 7.6852 6.68681C7.7552 4.42681 9.6052 2.61681 11.8652 2.60681H12.0052C14.2752 2.47681 16.2152 4.21681 16.3452 6.47681C16.3452 6.55681 16.3452 6.62681 16.3452 6.70681C16.4852 8.94681 15.9052 11.1768 14.6852 13.0568L14.6052 13.1768C14.0552 13.9868 13.1352 14.4668 12.1652 14.4768H12.0052C11.9352 14.4768 11.8652 14.4868 11.7952 14.4868L11.8052 14.4968Z",stroke:"currentColor"}),h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M4.3252 21.5469C4.3552 20.4169 4.4752 19.2869 4.6752 18.1769C4.8952 17.1669 6.4752 16.0269 8.9052 15.1569C9.2352 15.0369 9.4852 14.7869 9.5952 14.4569L9.8052 14.0269",stroke:"currentColor"}),h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M14.425 14.4069L14.165 14.1569C14.375 14.5969 14.725 14.9569 15.155 15.1869C16.945 15.7969 19.125 16.9569 19.375 18.2069C19.585 19.3069 19.685 20.4269 19.675 21.5369",stroke:"currentColor"})),P=r=>h.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},h.createElement("g",{clipPath:"url(#clip0_841_1324)"},h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_841_1324"},h.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),j=r=>h.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),B=r=>h.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),h.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),W=q(({isLoading:r,values:o,fields:u=[],errors:s,className:l="",onChange:d,onBlur:p})=>{const n=`${l}__item`,E=x((e,t,a)=>{const i=e.options.map($=>({text:$.label,value:$.value}));return c(_,{error:a,className:k([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${l}--${e.id}`,disabled:r,children:c(y,{name:e.id,floatingLabel:`${e.label} ${e.required?"*":""}`,placeholder:e.label,"aria-label":e.label,options:i,onBlur:p,handleSelect:d,value:t||e.defaultValue})},e.id)},[l,r,n,p,d]),w=x((e,t,a)=>{const i=e.id==="email",$=i?c(R,{}):void 0,g=i?"username":"";return c(_,{error:a,className:k([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${l}--${e.id}`,disabled:r,children:c(T,{autoComplete:g,icon:$,type:"text",name:e.id,value:t||e.defaultValue,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:p,onChange:d})},e.id)},[l,r,n,p,d]),b=x((e,t,a)=>c(_,{error:a,className:k([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${l}--${e.id}`,disabled:r,children:c(N,{type:"text",name:e.id,value:t||e.defaultValue,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:p,onChange:d})},e.id),[l,r,n,p,d]),v=x((e,t,a)=>c(_,{error:a,className:k([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${l}--${e.id}`,disabled:r,children:c(A,{name:e.id,checked:t||e.defaultValue,placeholder:e.label,label:`${e.label} ${e.required?"*":""}`,onBlur:p,onChange:d})},e.id),[l,r,n,p,d]),f=x((e,t,a)=>c(_,{error:a,className:k([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${l}--${e.id}`,disabled:r,children:c(D,{type:"text",name:e.id,value:t===void 0?e.defaultValue:t,label:`${e.label} ${e.required?"*":""}`,onBlur:p,onChange:d})},e.id),[l,r,n,p,d]);return u.length?c(V,{children:u.map(e=>{const t=(s==null?void 0:s[e.id])??"",a=(o==null?void 0:o[e.id])??"";switch(e.fieldType){case"TEXT":return e.options.length?E(e,a,t):w(e,a,t);case"MULTILINE":return w(e,a,t);case"SELECT":return E(e,a,t);case"DATE":return b(e,a,t);case"BOOLEAN":return v(e,a,t);case"TEXTAREA":return f(e,a,t);default:return null}})}):null}),ne=({name:r,isLoading:o,children:u,className:s="defaultForm",fieldsConfig:l=[],submitCallback:d})=>{const{formData:p,errors:n,formRef:E,handleChange:w,handleBlur:b,handleSubmit:v}=Z({submitCallback:d,fieldsConfig:l});return L("form",{onSubmit:v,className:s,name:r,ref:E,children:[c(W,{fields:l,onChange:w,onBlur:b,errors:n,values:p,className:s,isLoading:o}),u]})},ae=({children:r,text:o,bottomLine:u=!0,className:s})=>L("div",{className:k(["auth-title",s]),"data-testid":"auth-title_id",children:[L("div",{className:"auth-title__text",children:[c("h1",{className:"auth-title__heading",children:o}),r]}),u?c("div",{className:"auth-title__hr"}):null]}),J={success:c(j,{}),warning:c(P,{}),error:c(B,{})},le=()=>{const[r,o]=C({}),u=m(s=>{if(!s||!s.type)return;const l=J[s.type];o({...s,icon:l})},[]);return{inLineAlertProps:r,handleSetInLineAlertProps:u}};export{te as B,ne as F,ae as T,re as c,ee as g,le as u};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
|
|
3
|
-
export interface FormInputsProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
errors?: Record<string, string>;
|
|
6
|
-
values?: Record<string, unknown>;
|
|
7
|
-
fields?: any;
|
|
8
|
-
isLoading?: boolean;
|
|
9
|
-
onChange?: (event: Event) => void;
|
|
10
|
-
onBlur?: (event: Event) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const FormInputs: FunctionComponent<FormInputsProps>;
|
|
13
|
-
//# sourceMappingURL=FormInputs.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
|
|
4
|
-
export interface TitleProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
text: string;
|
|
7
|
-
bottomLine: boolean;
|
|
8
|
-
children?: any;
|
|
9
|
-
}
|
|
10
|
-
export declare const Title: FunctionComponent<TitleProps & HTMLAttributes<HTMLDivElement>>;
|
|
11
|
-
//# sourceMappingURL=Title.d.ts.map
|
package/components/UI/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|