@axos-web-dev/shared-components 1.0.99 → 1.0.100-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ATMLocator/ATMLocator.js +8 -1
- package/dist/ArticlesSet/ArticlesSet.js +2 -2
- package/dist/Auth/ErrorAlert.js +10 -3
- package/dist/Blockquote/Blockquote.module.js +3 -3
- package/dist/Button/Button.js +10 -3
- package/dist/Calculators/Calculator.js +22 -3
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.d.ts +9 -0
- package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +219 -0
- package/dist/Calculators/MaxLoanCalculator/index.js +22 -5
- package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.d.ts +1 -0
- package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +2 -0
- package/dist/Calculators/MonthlyPaymentCalculator/index.js +15 -5
- package/dist/Calculators/index.d.ts +2 -1
- package/dist/Calculators/index.js +3 -1
- package/dist/Carousel/index.js +10 -3
- package/dist/Chatbot/Bubble.css.d.ts +1 -0
- package/dist/Chatbot/Bubble.css.js +5 -0
- package/dist/Chatbot/Bubble.d.ts +3 -0
- package/dist/Chatbot/Bubble.js +48 -0
- package/dist/Chatbot/Chat.d.ts +1 -0
- package/dist/Chatbot/Chat.js +165 -0
- package/dist/Chatbot/ChatWindow.css.d.ts +11 -0
- package/dist/Chatbot/ChatWindow.css.js +25 -0
- package/dist/Chatbot/ChatWindow.d.ts +23 -0
- package/dist/Chatbot/ChatWindow.js +202 -0
- package/dist/Chatbot/Chatbot.css.d.ts +1 -0
- package/dist/Chatbot/Chatbot.css.js +5 -0
- package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
- package/dist/Chatbot/Chatbot.d.ts +1 -0
- package/dist/Chatbot/Chatbot.js +39 -0
- package/dist/Chatbot/authenticate.d.ts +3 -0
- package/dist/Chatbot/authenticate.js +16 -0
- package/dist/Chatbot/index.d.ts +9 -0
- package/dist/Chatbot/index.js +31 -0
- package/dist/Chatbot/store/chat.d.ts +9 -0
- package/dist/Chatbot/store/chat.js +11 -0
- package/dist/Chatbot/store/messages.d.ts +14 -0
- package/dist/Chatbot/store/messages.js +12 -0
- package/dist/Chatbot/useHeadlessChat.d.ts +22 -0
- package/dist/Chatbot/useHeadlessChat.js +157 -0
- package/dist/Chevron/index.js +10 -3
- package/dist/Comparison/Comparison.js +10 -3
- package/dist/ExecutiveBio/ExecutiveBio.js +10 -3
- package/dist/FaqAccordion/index.js +10 -3
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +10 -3
- package/dist/Forms/ApplicationStart.d.ts +1 -1
- package/dist/Forms/ApplicationStart.js +111 -89
- package/dist/Forms/ApplyNow.d.ts +2 -2
- package/dist/Forms/ApplyNow.js +178 -146
- package/dist/Forms/ClearingForm.d.ts +1 -1
- package/dist/Forms/ClearingForm.js +184 -162
- package/dist/Forms/CommercialDeposits.d.ts +1 -1
- package/dist/Forms/CommercialDeposits.js +201 -179
- package/dist/Forms/CommercialLending.d.ts +1 -1
- package/dist/Forms/CommercialLending.js +278 -256
- package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
- package/dist/Forms/CommercialPremiumFinance.js +128 -106
- package/dist/Forms/ContactCompany.d.ts +1 -1
- package/dist/Forms/ContactCompany.js +113 -91
- package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
- package/dist/Forms/ContactCompanyTitle.js +127 -105
- package/dist/Forms/ContactUs.d.ts +1 -1
- package/dist/Forms/ContactUs.js +99 -77
- package/dist/Forms/ContactUsAAS.d.ts +1 -1
- package/dist/Forms/ContactUsAAS.js +180 -158
- package/dist/Forms/ContactUsBusiness.d.ts +1 -1
- package/dist/Forms/ContactUsBusiness.js +143 -115
- package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
- package/dist/Forms/ContactUsBusinessNameEmail.js +112 -84
- package/dist/Forms/ContactUsLVF.d.ts +3 -1
- package/dist/Forms/ContactUsLVF.js +127 -101
- package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
- package/dist/Forms/ContactUsNMLSId.js +126 -98
- package/dist/Forms/CpraRequest.d.ts +1 -1
- package/dist/Forms/CpraRequest.js +641 -619
- package/dist/Forms/CraPublicFile.d.ts +1 -1
- package/dist/Forms/CraPublicFile.js +118 -90
- package/dist/Forms/DealerServices.d.ts +1 -1
- package/dist/Forms/DealerServices.js +225 -204
- package/dist/Forms/EmailOnly.d.ts +1 -1
- package/dist/Forms/EmailOnly.js +65 -39
- package/dist/Forms/EmailUs.d.ts +1 -1
- package/dist/Forms/EmailUs.js +75 -53
- package/dist/Forms/FormProps.d.ts +3 -0
- package/dist/Forms/Forms.css.d.ts +18 -0
- package/dist/Forms/Forms.css.js +44 -38
- package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
- package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
- package/dist/Forms/HoneyPot/index.d.ts +23 -0
- package/dist/Forms/HoneyPot/index.js +69 -0
- package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +376 -348
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +10 -3
- package/dist/Forms/MortgageWarehouseLending.d.ts +11 -0
- package/dist/Forms/MortgageWarehouseLending.js +343 -0
- package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
- package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
- package/dist/Forms/ScheduleCall.d.ts +1 -1
- package/dist/Forms/ScheduleCall.js +156 -134
- package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
- package/dist/Forms/ScheduleCallPremier.js +178 -156
- package/dist/Forms/SuccesForm.js +13 -6
- package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
- package/dist/Forms/VendorQuestionnaire.js +817 -795
- package/dist/Forms/WcplSurvey.d.ts +1 -1
- package/dist/Forms/WcplSurvey.js +112 -90
- package/dist/Forms/applynow-utils.d.ts +1 -0
- package/dist/Forms/applynow-utils.js +48 -0
- package/dist/Forms/index.d.ts +3 -0
- package/dist/Forms/index.js +12 -2
- package/dist/HeroBanner/HeroBanner.js +42 -1
- package/dist/Hyperlink/index.js +10 -3
- package/dist/IconBillboard/sections/CallToActionSection.js +2 -1
- package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.js +6 -1
- package/dist/ImageLink/ImageLink.js +10 -3
- package/dist/ImageLink/ImageLinkSet.js +10 -3
- package/dist/ImageLink/index.js +10 -3
- package/dist/Input/Input.js +3 -1
- package/dist/Insight/Featured/CategorySelector.js +10 -3
- package/dist/Insight/Featured/Featured.js +10 -3
- package/dist/Insight/Featured/Header.js +10 -3
- package/dist/Modal/Modal.js +10 -3
- package/dist/NavigationMenu/AxosALTS/NavData.js +10 -3
- package/dist/NavigationMenu/AxosALTS/index.js +10 -3
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +25 -7
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosBank/NavData.js +10 -3
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +32 -8
- package/dist/NavigationMenu/AxosBank/index.js +10 -3
- package/dist/NavigationMenu/LaVictoire/NavData.js +10 -3
- package/dist/NavigationMenu/LaVictoire/index.js +10 -3
- package/dist/NavigationMenu/NavDataJson.d.ts +2 -0
- package/dist/NavigationMenu/NavDataJson.js +315 -0
- package/dist/NavigationMenu/Navbar.d.ts +5 -0
- package/dist/NavigationMenu/Navbar.js +201 -0
- package/dist/NavigationMenu/SignInNavButton.d.ts +1 -0
- package/dist/NavigationMenu/SignInNavButton.js +369 -0
- package/dist/SetContainer/SetContainer.js +10 -3
- package/dist/SocialMediaBar/iconsRepository.js +10 -3
- package/dist/Table/Table.d.ts +1 -1
- package/dist/VideoTile/VideoTile.js +10 -3
- package/dist/VideoWrapper/index.js +10 -3
- package/dist/assets/Blockquote/Blockquote.css.css +68 -68
- package/dist/assets/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css +3 -0
- package/dist/assets/Chatbot/Bubble.css +40 -0
- package/dist/assets/Chatbot/ChatWindow.css +107 -0
- package/dist/assets/Forms/Forms.css +135 -105
- package/dist/assets/Forms/HoneyPot/HoneyPot.css +8 -0
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +191 -191
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +473 -473
- package/dist/assets/utils/optimizeImage/optimizeImage.css.css +47 -47
- package/dist/icons/Logos/AXB.d.ts +8 -0
- package/dist/icons/Logos/AXB.js +74 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +43 -3
- package/dist/utils/allowedAxosDomains.js +2 -1
- package/dist/utils/optimizeImage/optimizeImage.module.js +3 -3
- package/package.json +136 -133
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { useForm, FormProvider } from "react-hook-form";
|
|
5
|
-
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
6
3
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
7
|
-
import "../
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import clsx from "clsx";
|
|
4
|
+
import { Button } from "../Button/Button.js";
|
|
5
|
+
import "../Button/Button.css.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "react-use";
|
|
12
8
|
import "../icons/ArrowIcon/ArrowIcon.css.js";
|
|
13
9
|
import SvgAxosX from "../icons/AxosX/index.js";
|
|
14
10
|
import SvgComponent from "../icons/AxosX/Blue.js";
|
|
@@ -30,10 +26,15 @@ import "../Input/InputTextArea.js";
|
|
|
30
26
|
import "../Input/DownPaymentInput.js";
|
|
31
27
|
import "../Input/RadioButton.js";
|
|
32
28
|
import { LoadingIndicator } from "../LoadingIndicator/index.js";
|
|
33
|
-
import
|
|
34
|
-
import "../
|
|
35
|
-
import "
|
|
36
|
-
import "
|
|
29
|
+
import "../utils/allowedAxosDomains.js";
|
|
30
|
+
import { associatedEmail } from "../utils/EverestValidity.js";
|
|
31
|
+
import { getVariant } from "../utils/getVariant.js";
|
|
32
|
+
import clsx from "clsx";
|
|
33
|
+
import { useForm, FormProvider } from "react-hook-form";
|
|
34
|
+
import { z } from "zod";
|
|
35
|
+
import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
|
|
36
|
+
import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
|
|
37
|
+
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
37
38
|
const CommercialPremiumFinance = ({
|
|
38
39
|
icon = false,
|
|
39
40
|
children,
|
|
@@ -45,6 +46,7 @@ const CommercialPremiumFinance = ({
|
|
|
45
46
|
headline,
|
|
46
47
|
callToAction,
|
|
47
48
|
validateEmail,
|
|
49
|
+
onValidate,
|
|
48
50
|
description,
|
|
49
51
|
id
|
|
50
52
|
}) => {
|
|
@@ -67,8 +69,16 @@ const CommercialPremiumFinance = ({
|
|
|
67
69
|
Insurance_Company__c: z.string(),
|
|
68
70
|
Type_of_Policy__c: z.string()
|
|
69
71
|
});
|
|
72
|
+
const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
73
|
+
if (!isValidHoneyPot(data)) {
|
|
74
|
+
ctx.addIssue({
|
|
75
|
+
code: z.ZodIssueCode.custom,
|
|
76
|
+
message: "fields are not valid."
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
70
80
|
const methods = useForm({
|
|
71
|
-
resolver: zodResolver(
|
|
81
|
+
resolver: zodResolver(gen_schema, {
|
|
72
82
|
async: true
|
|
73
83
|
}),
|
|
74
84
|
mode: "onBlur",
|
|
@@ -101,100 +111,112 @@ const CommercialPremiumFinance = ({
|
|
|
101
111
|
}
|
|
102
112
|
)
|
|
103
113
|
] }),
|
|
104
|
-
/* @__PURE__ */ jsxs(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
required: true,
|
|
127
|
-
error: !!errors.last_name,
|
|
128
|
-
helperText: errors.last_name?.message,
|
|
129
|
-
variant
|
|
130
|
-
}
|
|
131
|
-
) }),
|
|
132
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
133
|
-
Input,
|
|
134
|
-
{
|
|
135
|
-
id: "email",
|
|
136
|
-
...register("email", {
|
|
137
|
-
required: true,
|
|
138
|
-
validate: {
|
|
139
|
-
isValid: associatedEmail
|
|
114
|
+
/* @__PURE__ */ jsxs(
|
|
115
|
+
"form",
|
|
116
|
+
{
|
|
117
|
+
className: form,
|
|
118
|
+
onSubmit: async (e) => {
|
|
119
|
+
onValidate && onValidate(e);
|
|
120
|
+
await handleSubmit(submitForm)(e);
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
|
|
125
|
+
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
|
|
126
|
+
Input,
|
|
127
|
+
{
|
|
128
|
+
id: "first_name",
|
|
129
|
+
...register("first_name", { required: true }),
|
|
130
|
+
label: "First Name",
|
|
131
|
+
sizes: "medium",
|
|
132
|
+
required: true,
|
|
133
|
+
error: !!errors.first_name,
|
|
134
|
+
helperText: errors.first_name?.message,
|
|
135
|
+
variant
|
|
140
136
|
}
|
|
141
|
-
}),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
137
|
+
) }),
|
|
138
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
139
|
+
Input,
|
|
140
|
+
{
|
|
141
|
+
id: "last_name",
|
|
142
|
+
...register("last_name", { required: true }),
|
|
143
|
+
label: "Last Name",
|
|
144
|
+
sizes: "medium",
|
|
145
|
+
required: true,
|
|
146
|
+
error: !!errors.last_name,
|
|
147
|
+
helperText: errors.last_name?.message,
|
|
148
|
+
variant
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
152
|
+
Input,
|
|
153
|
+
{
|
|
154
|
+
id: "email",
|
|
155
|
+
...register("email", {
|
|
156
|
+
required: true,
|
|
157
|
+
validate: {
|
|
158
|
+
isValid: associatedEmail
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
label: "Email",
|
|
162
|
+
sizes: "medium",
|
|
163
|
+
required: true,
|
|
164
|
+
error: !!errors.email,
|
|
165
|
+
helperText: errors.email?.message,
|
|
166
|
+
variant
|
|
167
|
+
}
|
|
168
|
+
) }),
|
|
169
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
170
|
+
Input,
|
|
171
|
+
{
|
|
172
|
+
id: "Insurance_Company__c",
|
|
173
|
+
...register("Insurance_Company__c", {}),
|
|
174
|
+
label: "Insurance Company",
|
|
175
|
+
sizes: "medium",
|
|
176
|
+
error: !!errors.Insurance_Company__c,
|
|
177
|
+
helperText: errors.Insurance_Company__c?.message,
|
|
178
|
+
variant
|
|
179
|
+
}
|
|
180
|
+
) }),
|
|
181
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
182
|
+
Dropdown,
|
|
183
|
+
{
|
|
184
|
+
id: "Type_of_Policy__c",
|
|
185
|
+
...register("Type_of_Policy__c", {}),
|
|
186
|
+
label: "Type of Policy",
|
|
187
|
+
sizes: "medium",
|
|
188
|
+
variant,
|
|
189
|
+
defaultValue: "",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx("option", { value: "" }),
|
|
192
|
+
/* @__PURE__ */ jsx("option", { value: "Whole life", children: "Whole life" }),
|
|
193
|
+
/* @__PURE__ */ jsx("option", { value: "Index Universal Life", children: "Index Universal Life" })
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
) }),
|
|
197
|
+
/* @__PURE__ */ jsx(HoneyPot, { register, variant })
|
|
198
|
+
] }),
|
|
199
|
+
children,
|
|
200
|
+
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
201
|
+
/* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
|
|
202
|
+
LoadingIndicator,
|
|
203
|
+
{
|
|
204
|
+
style: { marginInline: "auto" },
|
|
205
|
+
variant
|
|
206
|
+
}
|
|
207
|
+
) : /* @__PURE__ */ jsx(
|
|
208
|
+
Button,
|
|
209
|
+
{
|
|
210
|
+
color: getVariant(callToAction?.variant),
|
|
211
|
+
as: "button",
|
|
212
|
+
type: "submit",
|
|
213
|
+
disabled: !isValid || isSubmitting,
|
|
214
|
+
children: callToAction?.displayText
|
|
215
|
+
}
|
|
216
|
+
) })
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
)
|
|
198
220
|
] }) }) }, id);
|
|
199
221
|
};
|
|
200
222
|
export {
|
|
@@ -7,4 +7,4 @@ export type ContactCompanyInputs = {
|
|
|
7
7
|
phone: string;
|
|
8
8
|
company: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const ContactCompany: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ContactCompany: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -32,6 +32,7 @@ import clsx from "clsx";
|
|
|
32
32
|
import { useForm, FormProvider } from "react-hook-form";
|
|
33
33
|
import * as z from "zod";
|
|
34
34
|
import { iconForm, headerContainer, headerForm, form, descriptionField, fullRowForm, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
|
|
35
|
+
import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
|
|
35
36
|
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
36
37
|
const ContactCompany = ({
|
|
37
38
|
icon = false,
|
|
@@ -45,6 +46,7 @@ const ContactCompany = ({
|
|
|
45
46
|
description,
|
|
46
47
|
callToAction,
|
|
47
48
|
validateEmail,
|
|
49
|
+
onValidate,
|
|
48
50
|
id
|
|
49
51
|
}) => {
|
|
50
52
|
const schema = z.object({
|
|
@@ -71,8 +73,16 @@ const ContactCompany = ({
|
|
|
71
73
|
}),
|
|
72
74
|
company: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Company is required." }).max(255, { message: "Company can have atmost 255 characters." })
|
|
73
75
|
});
|
|
76
|
+
const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
77
|
+
if (!isValidHoneyPot(data)) {
|
|
78
|
+
ctx.addIssue({
|
|
79
|
+
code: z.ZodIssueCode.custom,
|
|
80
|
+
message: "fields are not valid."
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
74
84
|
const methods = useForm({
|
|
75
|
-
resolver: zodResolver(
|
|
85
|
+
resolver: zodResolver(gen_schema, {
|
|
76
86
|
async: true
|
|
77
87
|
}),
|
|
78
88
|
mode: "all",
|
|
@@ -105,97 +115,109 @@ const ContactCompany = ({
|
|
|
105
115
|
}
|
|
106
116
|
)
|
|
107
117
|
] }),
|
|
108
|
-
/* @__PURE__ */ jsxs(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
placeholder: "Last Name",
|
|
132
|
-
required: true,
|
|
133
|
-
error: !!errors.last_name,
|
|
134
|
-
helperText: errors.last_name?.message,
|
|
135
|
-
variant
|
|
136
|
-
}
|
|
137
|
-
) }),
|
|
138
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
139
|
-
Input,
|
|
140
|
-
{
|
|
141
|
-
id: "email",
|
|
142
|
-
...register("email", {
|
|
143
|
-
required: true,
|
|
144
|
-
validate: {
|
|
145
|
-
isValid: associatedEmail
|
|
118
|
+
/* @__PURE__ */ jsxs(
|
|
119
|
+
"form",
|
|
120
|
+
{
|
|
121
|
+
className: form,
|
|
122
|
+
onSubmit: async (e) => {
|
|
123
|
+
onValidate && onValidate(e);
|
|
124
|
+
await handleSubmit(submitForm)(e);
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
},
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
|
|
129
|
+
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
|
|
130
|
+
Input,
|
|
131
|
+
{
|
|
132
|
+
id: "first_name",
|
|
133
|
+
...register("first_name", { required: true }),
|
|
134
|
+
label: "First Name",
|
|
135
|
+
sizes: "medium",
|
|
136
|
+
placeholder: "First Name",
|
|
137
|
+
required: true,
|
|
138
|
+
error: !!errors.first_name,
|
|
139
|
+
helperText: errors.first_name?.message,
|
|
140
|
+
variant
|
|
146
141
|
}
|
|
147
|
-
}),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
142
|
+
) }),
|
|
143
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
144
|
+
Input,
|
|
145
|
+
{
|
|
146
|
+
id: "last_name",
|
|
147
|
+
...register("last_name", { required: true }),
|
|
148
|
+
label: "Last Name",
|
|
149
|
+
sizes: "medium",
|
|
150
|
+
placeholder: "Last Name",
|
|
151
|
+
required: true,
|
|
152
|
+
error: !!errors.last_name,
|
|
153
|
+
helperText: errors.last_name?.message,
|
|
154
|
+
variant
|
|
155
|
+
}
|
|
156
|
+
) }),
|
|
157
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
158
|
+
Input,
|
|
159
|
+
{
|
|
160
|
+
id: "email",
|
|
161
|
+
...register("email", {
|
|
162
|
+
required: true,
|
|
163
|
+
validate: {
|
|
164
|
+
isValid: associatedEmail
|
|
165
|
+
}
|
|
166
|
+
}),
|
|
167
|
+
label: "Email",
|
|
168
|
+
sizes: "medium",
|
|
169
|
+
placeholder: "Email",
|
|
170
|
+
required: true,
|
|
171
|
+
error: !!errors.email,
|
|
172
|
+
helperText: errors.email?.message,
|
|
173
|
+
variant
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
177
|
+
InputPhone,
|
|
178
|
+
{
|
|
179
|
+
id: "phone",
|
|
180
|
+
...register("phone", { required: true, maxLength: 12 }),
|
|
181
|
+
label: "Phone",
|
|
182
|
+
sizes: "medium",
|
|
183
|
+
placeholder: "Phone",
|
|
184
|
+
required: true,
|
|
185
|
+
error: !!errors.phone,
|
|
186
|
+
helperText: errors.phone?.message,
|
|
187
|
+
variant
|
|
188
|
+
}
|
|
189
|
+
) }),
|
|
190
|
+
/* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
|
|
191
|
+
Input,
|
|
192
|
+
{
|
|
193
|
+
id: "company",
|
|
194
|
+
...register("company", { required: true }),
|
|
195
|
+
label: "Company",
|
|
196
|
+
sizes: "medium",
|
|
197
|
+
placeholder: "Company",
|
|
198
|
+
required: true,
|
|
199
|
+
error: !!errors.company,
|
|
200
|
+
helperText: errors.company?.message,
|
|
201
|
+
variant
|
|
202
|
+
}
|
|
203
|
+
) }),
|
|
204
|
+
/* @__PURE__ */ jsx(HoneyPot, { register, variant })
|
|
205
|
+
] }),
|
|
206
|
+
children,
|
|
207
|
+
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
208
|
+
/* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
|
|
209
|
+
Button,
|
|
210
|
+
{
|
|
211
|
+
color: getVariant(callToAction?.variant),
|
|
212
|
+
as: "button",
|
|
213
|
+
type: "submit",
|
|
214
|
+
disabled: !isValid || isSubmitting,
|
|
215
|
+
children: callToAction?.displayText
|
|
216
|
+
}
|
|
217
|
+
) })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
)
|
|
199
221
|
] }) }) }, id);
|
|
200
222
|
};
|
|
201
223
|
export {
|
|
@@ -8,4 +8,4 @@ export type ContactCompanyTitleInputs = {
|
|
|
8
8
|
company: string;
|
|
9
9
|
title: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const ContactCompanyTitle: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const ContactCompanyTitle: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|