@axos-web-dev/shared-components 1.0.100-chat.1 → 1.0.100-dev.10
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/Calculators/BuyDownCalculator/index.d.ts +1 -0
- package/dist/Calculators/BuyDownCalculator/index.js +162 -76
- package/dist/Chatbot/ChatWindow.css.d.ts +2 -0
- package/dist/Chatbot/ChatWindow.css.js +4 -0
- package/dist/Chatbot/ChatWindow.js +117 -50
- package/dist/Chatbot/index.js +3 -1
- package/dist/Chatbot/useHeadlessChat.d.ts +2 -1
- package/dist/Chatbot/useHeadlessChat.js +27 -9
- package/dist/Comparison/ComparisonSet.js +33 -24
- package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +16 -0
- package/dist/Forms/CommercialDepositsNoLendingOption.js +330 -0
- package/dist/Forms/ContactUsLVF.d.ts +5 -1
- package/dist/Forms/ContactUsLVF.js +8 -6
- package/dist/Forms/FormEnums.js +6 -15
- package/dist/Forms/QuickPricer/QuickPricerForm.js +1 -1
- package/dist/Forms/SalesforceFieldsForm.d.ts +5 -0
- package/dist/Forms/SalesforceFieldsForm.js +11 -1
- package/dist/Forms/index.d.ts +1 -0
- package/dist/Forms/index.js +2 -0
- package/dist/Input/Dropdown.js +1 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +3 -0
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +21 -0
- package/dist/StepItemSet/StepItemSet.css.d.ts +1 -0
- package/dist/StepItemSet/StepItemSet.css.js +9 -5
- package/dist/StepItemSet/StepItemSet.d.ts +6 -0
- package/dist/StepItemSet/StepItemSet.js +22 -3
- package/dist/StepItemSet/index.js +2 -1
- package/dist/assets/Chatbot/ChatWindow.css +17 -0
- package/dist/assets/Comparison/Comparison.css +3 -1
- package/dist/assets/StepItemSet/StepItemSet.css +27 -10
- package/dist/main.js +7 -2
- package/package.json +1 -1
|
@@ -12,7 +12,8 @@ function useHeadlessChat({
|
|
|
12
12
|
host,
|
|
13
13
|
getToken,
|
|
14
14
|
projectId = "axos",
|
|
15
|
-
debug = false
|
|
15
|
+
debug = false,
|
|
16
|
+
menuOption = "Support Virtual Agent"
|
|
16
17
|
}) {
|
|
17
18
|
const addMessage = useMessages((state) => state.addMessage);
|
|
18
19
|
const addMessages = useMessages((state) => state.addMessages);
|
|
@@ -33,9 +34,11 @@ function useHeadlessChat({
|
|
|
33
34
|
if (chatRef.current) {
|
|
34
35
|
await clientRef.current?.finishChat();
|
|
35
36
|
clearMessages();
|
|
36
|
-
clientRef.current?.createChat(
|
|
37
|
+
clientRef.current?.createChat(
|
|
38
|
+
menuRef.current.menus.find((menu) => menu.name === menuOption)?.id
|
|
39
|
+
);
|
|
37
40
|
}
|
|
38
|
-
}, [clearMessages]);
|
|
41
|
+
}, [clearMessages, menuOption]);
|
|
39
42
|
useEffect(() => {
|
|
40
43
|
let messageHandler;
|
|
41
44
|
let chatReadyHandler;
|
|
@@ -66,11 +69,17 @@ function useHeadlessChat({
|
|
|
66
69
|
}
|
|
67
70
|
menuRef.current = await clientRef.current?.getMenus();
|
|
68
71
|
if (debug) console.log("channelId:", menuRef.current);
|
|
69
|
-
if (debug)
|
|
72
|
+
if (debug)
|
|
73
|
+
console.log(
|
|
74
|
+
"channelId:",
|
|
75
|
+
menuRef.current?.menus.find((menu) => menu.name === menuOption)?.id
|
|
76
|
+
);
|
|
70
77
|
try {
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
chatRef.current = await clientRef.current?.resumeChat(
|
|
78
|
+
chatRef.current = await clientRef.current?.loadOngoingChat();
|
|
79
|
+
if (chatRef.current != null) {
|
|
80
|
+
chatRef.current = await clientRef.current?.resumeChat(
|
|
81
|
+
chatRef.current?.state?.id
|
|
82
|
+
);
|
|
74
83
|
if (debug) console.log("Resumed chatRef:", chatRef.current);
|
|
75
84
|
} else {
|
|
76
85
|
const custom_data = {
|
|
@@ -78,11 +87,19 @@ function useHeadlessChat({
|
|
|
78
87
|
facingBrandId: {
|
|
79
88
|
label: "facingBrandId",
|
|
80
89
|
value: brandMap.get(projectId) || 1
|
|
90
|
+
},
|
|
91
|
+
channel: {
|
|
92
|
+
label: "channel",
|
|
93
|
+
value: "in_web"
|
|
94
|
+
},
|
|
95
|
+
user_auth: {
|
|
96
|
+
label: "user_auth",
|
|
97
|
+
value: false
|
|
81
98
|
}
|
|
82
99
|
}
|
|
83
100
|
};
|
|
84
101
|
chatRef.current = await clientRef.current?.createChat(
|
|
85
|
-
menuRef.current.menus
|
|
102
|
+
menuRef.current.menus.find((menu) => menu.name === menuOption)?.id,
|
|
86
103
|
{
|
|
87
104
|
custom_data
|
|
88
105
|
}
|
|
@@ -177,7 +194,8 @@ function useHeadlessChat({
|
|
|
177
194
|
addMessage,
|
|
178
195
|
addMessages,
|
|
179
196
|
debug,
|
|
180
|
-
projectId
|
|
197
|
+
projectId,
|
|
198
|
+
menuOption
|
|
181
199
|
]);
|
|
182
200
|
return {
|
|
183
201
|
status,
|
|
@@ -35,30 +35,39 @@ const ComparisonSet = ({
|
|
|
35
35
|
bodyCopy,
|
|
36
36
|
additionalDetails,
|
|
37
37
|
isolate: true,
|
|
38
|
-
children: /* @__PURE__ */ jsxs(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
children: /* @__PURE__ */ jsxs(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: clsx(
|
|
42
|
+
comparison_container,
|
|
43
|
+
comparisonElements.length > 2 && "comparison_container--many_items"
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(TabContainer, { className: comparison_tab_container, children: comparisonElements.map(({ headerTab, id: id2 }, index) => /* @__PURE__ */ jsx(
|
|
47
|
+
Tab,
|
|
48
|
+
{
|
|
49
|
+
id: `tab_${id2}_${index}`,
|
|
50
|
+
headline: `${headerTab}`,
|
|
51
|
+
onClick: () => {
|
|
52
|
+
toggleTab(index);
|
|
53
|
+
},
|
|
54
|
+
className: toggleState === index ? active_tab({ variant: getVariant(variant) }) : "",
|
|
55
|
+
variant
|
|
56
|
+
},
|
|
57
|
+
`tab_${id2}_${index}`
|
|
58
|
+
)) }),
|
|
59
|
+
comparisonElements.map((item, index) => /* @__PURE__ */ createElement(
|
|
60
|
+
Comparison,
|
|
61
|
+
{
|
|
62
|
+
...item,
|
|
63
|
+
key: item.id,
|
|
64
|
+
index,
|
|
65
|
+
toggleState
|
|
66
|
+
}
|
|
67
|
+
))
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
62
71
|
}
|
|
63
72
|
);
|
|
64
73
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormProps } from './FormProps';
|
|
2
|
+
|
|
3
|
+
export type CommercialDepositsNoLendingOptionInputs = {
|
|
4
|
+
first_name: string;
|
|
5
|
+
last_name: string;
|
|
6
|
+
company: string;
|
|
7
|
+
email: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
Estimated_Gross_Annual_Revenue__c: string;
|
|
10
|
+
Banking__c: boolean;
|
|
11
|
+
Treasury_Management__c: boolean;
|
|
12
|
+
Others__c: boolean;
|
|
13
|
+
Others_Detail__c: string;
|
|
14
|
+
Product_and_servicing_needs__c: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const CommercialDepositsNoLendingOption: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
+
import { Button } from "../Button/Button.js";
|
|
5
|
+
import "../Button/Button.css.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "react-use";
|
|
8
|
+
import { Checkbox } from "../Input/Checkbox.js";
|
|
9
|
+
import "../Input/CurrencyInput.js";
|
|
10
|
+
import { Dropdown } from "../Input/Dropdown.js";
|
|
11
|
+
import "../Input/Dropdown.css.js";
|
|
12
|
+
import { Input } from "../Input/Input.js";
|
|
13
|
+
import "../Input/Input.css.js";
|
|
14
|
+
import "../Input/InputAmount.js";
|
|
15
|
+
import { InputPhone } from "../Input/InputPhone.js";
|
|
16
|
+
import "../Input/InputTextArea.js";
|
|
17
|
+
import "../Input/DownPaymentInput.js";
|
|
18
|
+
import "../Input/RadioButton.js";
|
|
19
|
+
import "../icons/ArrowIcon/ArrowIcon.css.js";
|
|
20
|
+
import SvgAxosX from "../icons/AxosX/index.js";
|
|
21
|
+
import SvgComponent from "../icons/AxosX/Blue.js";
|
|
22
|
+
import "../icons/CheckIcon/CheckIcon.css.js";
|
|
23
|
+
import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
|
|
24
|
+
/* empty css */
|
|
25
|
+
/* empty css */
|
|
26
|
+
/* empty css */
|
|
27
|
+
/* empty css */
|
|
28
|
+
import "../utils/allowedAxosDomains.js";
|
|
29
|
+
import { associatedEmail } from "../utils/EverestValidity.js";
|
|
30
|
+
import { getVariant } from "../utils/getVariant.js";
|
|
31
|
+
import clsx from "clsx";
|
|
32
|
+
import { useForm, FormProvider } from "react-hook-form";
|
|
33
|
+
import * as z from "zod";
|
|
34
|
+
import { iconForm, headerForm, form, descriptionField, headerContainer, x_input, fullRowForm, pl_label, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
|
|
35
|
+
import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
|
|
36
|
+
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
37
|
+
const CommercialDepositsNoLendingOption = ({
|
|
38
|
+
icon = false,
|
|
39
|
+
children,
|
|
40
|
+
onSubmit = (values) => {
|
|
41
|
+
console.log(values);
|
|
42
|
+
},
|
|
43
|
+
disclosure,
|
|
44
|
+
variant: fullVariant = "primary",
|
|
45
|
+
headline,
|
|
46
|
+
description,
|
|
47
|
+
callToAction,
|
|
48
|
+
validateEmail,
|
|
49
|
+
onValidate,
|
|
50
|
+
id
|
|
51
|
+
}) => {
|
|
52
|
+
const schema = z.object({
|
|
53
|
+
first_name: z.string({ message: "First Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
|
|
54
|
+
message: "First Name is required."
|
|
55
|
+
}).trim().min(1, { message: "First Name is required." }),
|
|
56
|
+
last_name: z.string({ message: "Last Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
|
|
57
|
+
message: "Last Name is required."
|
|
58
|
+
}).trim().min(1, { message: "Last Name is required." }),
|
|
59
|
+
email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
|
|
60
|
+
phone: z.string({ message: "Business Phone is required." }).regex(/[\d-]{10}/, { message: "Business Phone is required." }).min(10, { message: "Business Phone is required." }).max(12, { message: "Business Phone is required." }).transform((val, ctx) => {
|
|
61
|
+
const removeDashes = val.replace(/-/gi, "");
|
|
62
|
+
if (removeDashes.length !== 10) {
|
|
63
|
+
ctx.addIssue({
|
|
64
|
+
code: z.ZodIssueCode.custom,
|
|
65
|
+
message: "Business Phone must have at least 10 and no more than 10 characters."
|
|
66
|
+
});
|
|
67
|
+
return z.NEVER;
|
|
68
|
+
}
|
|
69
|
+
if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
|
|
70
|
+
ctx.addIssue({
|
|
71
|
+
code: z.ZodIssueCode.custom,
|
|
72
|
+
message: "Invalid phone number."
|
|
73
|
+
});
|
|
74
|
+
return z.NEVER;
|
|
75
|
+
}
|
|
76
|
+
return removeDashes;
|
|
77
|
+
}),
|
|
78
|
+
company: z.string({ message: "Business Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
|
|
79
|
+
message: "Business Name is required"
|
|
80
|
+
}).trim().min(1, { message: "Business Name is required." }),
|
|
81
|
+
Estimated_Gross_Annual_Revenue__c: z.string({
|
|
82
|
+
message: "Estimated gross annual revenue is required"
|
|
83
|
+
}).min(1, { message: "Estimated gross annual revenue is required" }),
|
|
84
|
+
Banking__c: z.boolean(),
|
|
85
|
+
Treasury_Management__c: z.boolean(),
|
|
86
|
+
Others__c: z.boolean().optional(),
|
|
87
|
+
Others_Detail__c: z.string().optional(),
|
|
88
|
+
Product_and_servicing_needs__c: z.string()
|
|
89
|
+
});
|
|
90
|
+
const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
91
|
+
if (!isValidHoneyPot(data)) {
|
|
92
|
+
ctx.addIssue({
|
|
93
|
+
code: z.ZodIssueCode.custom,
|
|
94
|
+
message: "fields are not valid."
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const methods = useForm({
|
|
99
|
+
resolver: zodResolver(gen_schema, {
|
|
100
|
+
async: true
|
|
101
|
+
}),
|
|
102
|
+
mode: "all"
|
|
103
|
+
});
|
|
104
|
+
const {
|
|
105
|
+
handleSubmit,
|
|
106
|
+
register,
|
|
107
|
+
watch,
|
|
108
|
+
formState: { errors, isValid, isSubmitting }
|
|
109
|
+
} = methods;
|
|
110
|
+
const othersChecked = watch("Others__c");
|
|
111
|
+
const submitForm = async (data) => {
|
|
112
|
+
const processData = {
|
|
113
|
+
...data,
|
|
114
|
+
Banking__c: data.Banking__c ? true : false
|
|
115
|
+
};
|
|
116
|
+
await onSubmit(processData);
|
|
117
|
+
};
|
|
118
|
+
const variant = getVariant(fullVariant);
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
"section",
|
|
121
|
+
{
|
|
122
|
+
id: `id_${id}`,
|
|
123
|
+
className: clsx(formContainer({ variant })),
|
|
124
|
+
children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
|
|
125
|
+
icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(headerContainer, "text_center"), children: [
|
|
127
|
+
/* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
|
|
128
|
+
description && /* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: clsx(
|
|
132
|
+
form,
|
|
133
|
+
descriptionField({ variant }),
|
|
134
|
+
"text_center"
|
|
135
|
+
),
|
|
136
|
+
children: description
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ jsxs(
|
|
141
|
+
"form",
|
|
142
|
+
{
|
|
143
|
+
className: form,
|
|
144
|
+
onSubmit: async (e) => {
|
|
145
|
+
onValidate && onValidate(e);
|
|
146
|
+
await handleSubmit(submitForm)(e);
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
|
|
151
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
152
|
+
Input,
|
|
153
|
+
{
|
|
154
|
+
id: "first_name",
|
|
155
|
+
...register("first_name", {
|
|
156
|
+
required: "First Name is required"
|
|
157
|
+
}),
|
|
158
|
+
label: "First Name",
|
|
159
|
+
sizes: "medium",
|
|
160
|
+
required: true,
|
|
161
|
+
error: !!errors.first_name,
|
|
162
|
+
helperText: errors.first_name?.message,
|
|
163
|
+
variant
|
|
164
|
+
}
|
|
165
|
+
) }),
|
|
166
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
167
|
+
Input,
|
|
168
|
+
{
|
|
169
|
+
id: "last_name",
|
|
170
|
+
...register("last_name", { required: true }),
|
|
171
|
+
label: "Last Name",
|
|
172
|
+
sizes: "medium",
|
|
173
|
+
required: true,
|
|
174
|
+
error: !!errors.last_name,
|
|
175
|
+
helperText: errors.last_name?.message,
|
|
176
|
+
variant
|
|
177
|
+
}
|
|
178
|
+
) }),
|
|
179
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
180
|
+
Input,
|
|
181
|
+
{
|
|
182
|
+
id: "company",
|
|
183
|
+
...register("company", { required: true }),
|
|
184
|
+
label: "Business Name",
|
|
185
|
+
sizes: "medium",
|
|
186
|
+
required: true,
|
|
187
|
+
error: !!errors.company,
|
|
188
|
+
helperText: errors.company?.message,
|
|
189
|
+
variant
|
|
190
|
+
}
|
|
191
|
+
) }),
|
|
192
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
193
|
+
Input,
|
|
194
|
+
{
|
|
195
|
+
id: "email",
|
|
196
|
+
...register("email", {
|
|
197
|
+
required: true,
|
|
198
|
+
validate: {
|
|
199
|
+
isValid: associatedEmail
|
|
200
|
+
}
|
|
201
|
+
}),
|
|
202
|
+
label: "Email",
|
|
203
|
+
sizes: "medium",
|
|
204
|
+
required: true,
|
|
205
|
+
error: !!errors.email,
|
|
206
|
+
helperText: errors.email?.message,
|
|
207
|
+
variant
|
|
208
|
+
}
|
|
209
|
+
) }),
|
|
210
|
+
/* @__PURE__ */ jsx("div", { className: x_input, children: /* @__PURE__ */ jsx(
|
|
211
|
+
InputPhone,
|
|
212
|
+
{
|
|
213
|
+
id: "phone",
|
|
214
|
+
...register("phone", { required: true, maxLength: 12 }),
|
|
215
|
+
label: "Business Phone",
|
|
216
|
+
sizes: "medium",
|
|
217
|
+
required: true,
|
|
218
|
+
error: !!errors.phone,
|
|
219
|
+
helperText: errors.phone?.message,
|
|
220
|
+
variant
|
|
221
|
+
}
|
|
222
|
+
) }),
|
|
223
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
224
|
+
Dropdown,
|
|
225
|
+
{
|
|
226
|
+
id: "Estimated_Gross_Annual_Revenue__c",
|
|
227
|
+
...register("Estimated_Gross_Annual_Revenue__c", {
|
|
228
|
+
required: true
|
|
229
|
+
}),
|
|
230
|
+
label: "Estimated Gross Annual Revenue",
|
|
231
|
+
sizes: "medium",
|
|
232
|
+
required: true,
|
|
233
|
+
error: !!errors.Estimated_Gross_Annual_Revenue__c,
|
|
234
|
+
helperText: errors.Estimated_Gross_Annual_Revenue__c?.message,
|
|
235
|
+
variant,
|
|
236
|
+
defaultValue: "",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ jsx("option", { disabled: true, value: "", children: "Select Option" }),
|
|
239
|
+
/* @__PURE__ */ jsx("option", { value: "Under $3MM", children: "Under $3MM" }),
|
|
240
|
+
/* @__PURE__ */ jsx("option", { value: "$3MM - $10MM", children: "$3MM - $10MM" }),
|
|
241
|
+
/* @__PURE__ */ jsx("option", { value: "$10MM - $100MM", children: "$10MM - $100MM" }),
|
|
242
|
+
/* @__PURE__ */ jsx("option", { value: "Above $100MM", children: "Above $100MM" })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
) }),
|
|
246
|
+
/* @__PURE__ */ jsxs("div", { className: `${fullRowForm}`, children: [
|
|
247
|
+
/* @__PURE__ */ jsx("div", { className: pl_label, children: "Which products or services apply to your request? Click all that apply." }),
|
|
248
|
+
/* @__PURE__ */ jsx(
|
|
249
|
+
Checkbox,
|
|
250
|
+
{
|
|
251
|
+
id: "Banking__c",
|
|
252
|
+
...register("Banking__c"),
|
|
253
|
+
sizes: "medium",
|
|
254
|
+
variant,
|
|
255
|
+
children: "Banking"
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ jsx(
|
|
259
|
+
Checkbox,
|
|
260
|
+
{
|
|
261
|
+
id: "Treasury_Management__c",
|
|
262
|
+
...register("Treasury_Management__c"),
|
|
263
|
+
sizes: "medium",
|
|
264
|
+
variant,
|
|
265
|
+
children: "Treasury Management"
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsx(
|
|
269
|
+
Checkbox,
|
|
270
|
+
{
|
|
271
|
+
id: "Others__c",
|
|
272
|
+
...register("Others__c"),
|
|
273
|
+
sizes: "medium",
|
|
274
|
+
variant,
|
|
275
|
+
children: "Other"
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
othersChecked && /* @__PURE__ */ jsx(
|
|
279
|
+
Input,
|
|
280
|
+
{
|
|
281
|
+
id: "Others_Detail__c",
|
|
282
|
+
...register("Others_Detail__c", { required: false }),
|
|
283
|
+
sizes: "medium",
|
|
284
|
+
required: false,
|
|
285
|
+
error: !!errors.Others_Detail__c,
|
|
286
|
+
helperText: errors.Others_Detail__c?.message,
|
|
287
|
+
variant
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
|
|
292
|
+
Input,
|
|
293
|
+
{
|
|
294
|
+
id: "Product_and_servicing_needs__c",
|
|
295
|
+
...register("Product_and_servicing_needs__c", {
|
|
296
|
+
required: false
|
|
297
|
+
}),
|
|
298
|
+
label: "Kindly describe your product and/or servicing needs.",
|
|
299
|
+
sizes: "medium",
|
|
300
|
+
required: false,
|
|
301
|
+
error: !!errors.Product_and_servicing_needs__c,
|
|
302
|
+
helperText: errors.Product_and_servicing_needs__c?.message,
|
|
303
|
+
variant
|
|
304
|
+
}
|
|
305
|
+
) }),
|
|
306
|
+
/* @__PURE__ */ jsx(HoneyPot, { register, variant })
|
|
307
|
+
] }),
|
|
308
|
+
children,
|
|
309
|
+
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
310
|
+
/* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
|
|
311
|
+
Button,
|
|
312
|
+
{
|
|
313
|
+
color: getVariant(callToAction?.variant),
|
|
314
|
+
as: "button",
|
|
315
|
+
type: "submit",
|
|
316
|
+
disabled: !isValid || isSubmitting,
|
|
317
|
+
children: callToAction?.displayText
|
|
318
|
+
}
|
|
319
|
+
) })
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }) })
|
|
324
|
+
},
|
|
325
|
+
id
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
export {
|
|
329
|
+
CommercialDepositsNoLendingOption
|
|
330
|
+
};
|
|
@@ -8,6 +8,10 @@ export type ContactUsLaVictoireInputs = {
|
|
|
8
8
|
message: string;
|
|
9
9
|
checkbox: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const ContactUsLVF: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, dealerCheckbox, }: FormProps & {
|
|
11
|
+
export declare const ContactUsLVF: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, dealerCheckbox, contextData, }: FormProps & {
|
|
12
12
|
dealerCheckbox?: boolean;
|
|
13
|
+
contextData?: {
|
|
14
|
+
pageName?: string;
|
|
15
|
+
pageUri?: string;
|
|
16
|
+
};
|
|
13
17
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,6 +33,7 @@ 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
35
|
import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
|
|
36
|
+
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
36
37
|
const ContactUsLVF = ({
|
|
37
38
|
icon = false,
|
|
38
39
|
children,
|
|
@@ -47,7 +48,8 @@ const ContactUsLVF = ({
|
|
|
47
48
|
validateEmail,
|
|
48
49
|
onValidate,
|
|
49
50
|
id,
|
|
50
|
-
dealerCheckbox = true
|
|
51
|
+
dealerCheckbox = true,
|
|
52
|
+
contextData
|
|
51
53
|
}) => {
|
|
52
54
|
const schema = z.object({
|
|
53
55
|
firstname: z.string().regex(/^[a-zA-Z]*(?:[a-zA-Z][a-zA-Z'-]*\s{0,1}){2,}$/g, {
|
|
@@ -78,7 +80,7 @@ const ContactUsLVF = ({
|
|
|
78
80
|
message: z.string().min(1, { message: "Please complete this required field." }),
|
|
79
81
|
checkbox: z.boolean()
|
|
80
82
|
});
|
|
81
|
-
const gen_schema = schema.merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
83
|
+
const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
82
84
|
if (!isValidHoneyPot(data)) {
|
|
83
85
|
ctx.addIssue({
|
|
84
86
|
code: z.ZodIssueCode.custom,
|
|
@@ -106,9 +108,9 @@ const ContactUsLVF = ({
|
|
|
106
108
|
return { name: key, value: data[key] };
|
|
107
109
|
}
|
|
108
110
|
}).filter((el) => el !== void 0);
|
|
109
|
-
const
|
|
110
|
-
pageName: "La Victoire Finance",
|
|
111
|
-
pageUri: "https://lavictoirefinance.com/contact-us"
|
|
111
|
+
const finalContextData = {
|
|
112
|
+
pageName: contextData?.pageName || "La Victoire Finance",
|
|
113
|
+
pageUri: contextData?.pageUri || "https://lavictoirefinance.com/contact-us"
|
|
112
114
|
};
|
|
113
115
|
const legalConsentData = {
|
|
114
116
|
consent: {
|
|
@@ -125,7 +127,7 @@ const ContactUsLVF = ({
|
|
|
125
127
|
};
|
|
126
128
|
await onSubmit({
|
|
127
129
|
fields: formattedFieldsData,
|
|
128
|
-
context:
|
|
130
|
+
context: finalContextData,
|
|
129
131
|
legalConsentOptions: legalConsentData,
|
|
130
132
|
form: "contactUSLVF"
|
|
131
133
|
});
|
package/dist/Forms/FormEnums.js
CHANGED
|
@@ -48,7 +48,9 @@ const PurposeOfLoan = ["Bridge", "Construction"];
|
|
|
48
48
|
const Purposes = [
|
|
49
49
|
{ value: "Purchase", text: "Purchase" },
|
|
50
50
|
{ value: "RefiCashout", text: "Refi Cashout" },
|
|
51
|
-
{ value: "RefiRateTermLimitedCO", text: "Refi Rate-Term/Limited C.O." }
|
|
51
|
+
{ value: "RefiRateTermLimitedCO", text: "Refi Rate-Term/Limited C.O." },
|
|
52
|
+
{ value: "ConstructiontoPerm", text: "Construction to Perm" },
|
|
53
|
+
{ value: "InvestorConstruction", text: "Investor Construction" }
|
|
52
54
|
];
|
|
53
55
|
const RepresentativesFico = [
|
|
54
56
|
{ value: "780", text: "780+" },
|
|
@@ -65,6 +67,7 @@ const RepresentativesFico = [
|
|
|
65
67
|
const DocType = [
|
|
66
68
|
{ value: "FullDoc", text: "Full Doc" },
|
|
67
69
|
{ value: "AssetDepletion", text: "Asset Depletion" },
|
|
70
|
+
{ value: "AssetUtilization", text: "Asset Utilization" },
|
|
68
71
|
{ value: "PersonalBankStmt12Mos", text: "Personal Bank Stmt: 12 Mos" },
|
|
69
72
|
{ value: "BusinessBankStmt12Mos", text: "Business Bank Stmt: 12 Mos" },
|
|
70
73
|
{ value: "PersonalBankStmt24Mos", text: "Personal Bank Stmt: 24 Mos" },
|
|
@@ -177,20 +180,8 @@ const Fico = [
|
|
|
177
180
|
{ value: "720-759", text: "720-759" },
|
|
178
181
|
{ value: "700-719", text: "700-719" }
|
|
179
182
|
];
|
|
180
|
-
const BuydownRate = [
|
|
181
|
-
|
|
182
|
-
{ value: 3.99, text: "3.99%" },
|
|
183
|
-
{ value: 4.99, text: "4.99%" },
|
|
184
|
-
{ value: 5.99, text: "5.99%" },
|
|
185
|
-
{ value: 6.99, text: "6.99%" }
|
|
186
|
-
];
|
|
187
|
-
const BuydownTerm = [
|
|
188
|
-
{ value: 1, text: "1 Year" },
|
|
189
|
-
{ value: 2, text: "2 Years" },
|
|
190
|
-
{ value: 3, text: "3 Years" },
|
|
191
|
-
{ value: 4, text: "4 Years" },
|
|
192
|
-
{ value: 5, text: "5 Years" }
|
|
193
|
-
];
|
|
183
|
+
const BuydownRate = [{ value: 3.74, text: "3.74%" }];
|
|
184
|
+
const BuydownTerm = [{ value: 3, text: "3 Years" }];
|
|
194
185
|
const LoanRates = /* @__PURE__ */ new Map([
|
|
195
186
|
[
|
|
196
187
|
"3/6 SOFR ARM",
|
|
@@ -13,6 +13,7 @@ export interface SalesforceFields {
|
|
|
13
13
|
experience_id: string;
|
|
14
14
|
hem: string;
|
|
15
15
|
identity: string;
|
|
16
|
+
leadPriority: string;
|
|
16
17
|
}
|
|
17
18
|
export interface SalesforceInputs {
|
|
18
19
|
Brand_SFDC2__c: string;
|
|
@@ -46,6 +47,7 @@ export interface SalesforceInputs {
|
|
|
46
47
|
experience_id: string;
|
|
47
48
|
hem: string;
|
|
48
49
|
identity: string;
|
|
50
|
+
LeadPriority__c: string;
|
|
49
51
|
}
|
|
50
52
|
export declare const SalesforceSchema: z.ZodObject<{
|
|
51
53
|
Brand_SFDC2__c: z.ZodOptional<z.ZodString>;
|
|
@@ -71,6 +73,7 @@ export declare const SalesforceSchema: z.ZodObject<{
|
|
|
71
73
|
First_UTMIdentity__c: z.ZodOptional<z.ZodString>;
|
|
72
74
|
First_UTMExperience_Id__c: z.ZodOptional<z.ZodString>;
|
|
73
75
|
Full_Web_Source__c: z.ZodOptional<z.ZodString>;
|
|
76
|
+
LeadPriority__c: z.ZodOptional<z.ZodString>;
|
|
74
77
|
}, "strip", z.ZodTypeAny, {
|
|
75
78
|
Brand_SFDC2__c?: string | undefined;
|
|
76
79
|
Branch_SFDC2__c?: string | undefined;
|
|
@@ -95,6 +98,7 @@ export declare const SalesforceSchema: z.ZodObject<{
|
|
|
95
98
|
First_UTMIdentity__c?: string | undefined;
|
|
96
99
|
First_UTMExperience_Id__c?: string | undefined;
|
|
97
100
|
Full_Web_Source__c?: string | undefined;
|
|
101
|
+
LeadPriority__c?: string | undefined;
|
|
98
102
|
}, {
|
|
99
103
|
Brand_SFDC2__c?: string | undefined;
|
|
100
104
|
Branch_SFDC2__c?: string | undefined;
|
|
@@ -119,6 +123,7 @@ export declare const SalesforceSchema: z.ZodObject<{
|
|
|
119
123
|
First_UTMIdentity__c?: string | undefined;
|
|
120
124
|
First_UTMExperience_Id__c?: string | undefined;
|
|
121
125
|
Full_Web_Source__c?: string | undefined;
|
|
126
|
+
LeadPriority__c?: string | undefined;
|
|
122
127
|
}>;
|
|
123
128
|
export interface QueryParams {
|
|
124
129
|
[str: string]: string;
|
|
@@ -33,7 +33,8 @@ const SalesforceSchema = z.object({
|
|
|
33
33
|
First_UTMHem__c: z.string().optional(),
|
|
34
34
|
First_UTMIdentity__c: z.string().optional(),
|
|
35
35
|
First_UTMExperience_Id__c: z.string().optional(),
|
|
36
|
-
Full_Web_Source__c: z.string().optional()
|
|
36
|
+
Full_Web_Source__c: z.string().optional(),
|
|
37
|
+
LeadPriority__c: z.string().optional()
|
|
37
38
|
});
|
|
38
39
|
const SalesforceFieldsForm = memo(function SaleforceFieldForm({
|
|
39
40
|
salesforceFields,
|
|
@@ -87,6 +88,15 @@ const SalesforceFieldsForm = memo(function SaleforceFieldForm({
|
|
|
87
88
|
})
|
|
88
89
|
}
|
|
89
90
|
),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
"input",
|
|
93
|
+
{
|
|
94
|
+
type: "hidden",
|
|
95
|
+
...register("LeadPriority__c", {
|
|
96
|
+
value: salesforceFields?.leadPriority
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
),
|
|
90
100
|
/* @__PURE__ */ jsx("input", { type: "hidden", ...register("lead_source", { value: "Web RMI" }) }),
|
|
91
101
|
/* @__PURE__ */ jsx(
|
|
92
102
|
"input",
|
package/dist/Forms/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './ApplyNow';
|
|
|
3
3
|
export * from './applynow-utils';
|
|
4
4
|
export * from './ClearingForm';
|
|
5
5
|
export * from './CommercialDeposits';
|
|
6
|
+
export * from './CommercialDepositsNoLendingOption';
|
|
6
7
|
export * from './CommercialLending';
|
|
7
8
|
export * from './CommercialPremiumFinance';
|
|
8
9
|
export * from './ContactCompany';
|