@axos-web-dev/shared-components 1.0.99-dev.1 → 1.0.99-dev.3
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 +1 -0
- package/dist/Auth/ErrorAlert.js +1 -0
- package/dist/Button/Button.js +1 -0
- package/dist/Calculators/Calculator.js +1 -0
- package/dist/Carousel/index.js +1 -0
- package/dist/Chevron/index.js +1 -0
- package/dist/Comparison/Comparison.js +1 -0
- package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
- package/dist/FaqAccordion/index.js +1 -0
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
- package/dist/Forms/ApplicationStart.d.ts +1 -1
- package/dist/Forms/ApplicationStart.js +111 -89
- package/dist/Forms/ApplyNow.js +1 -0
- 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 -78
- 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 +134 -112
- package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
- package/dist/Forms/ContactUsBusinessNameEmail.js +103 -81
- package/dist/Forms/ContactUsLVF.d.ts +1 -1
- package/dist/Forms/ContactUsLVF.js +120 -98
- package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
- package/dist/Forms/ContactUsNMLSId.js +117 -95
- 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 +109 -87
- 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 +56 -36
- 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/HoneyPot/HoneyPot.css.d.ts +1 -0
- package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
- package/dist/Forms/HoneyPot/index.d.ts +24 -0
- package/dist/Forms/HoneyPot/index.js +71 -0
- package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +363 -342
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -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 +1 -0
- 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/index.d.ts +1 -0
- package/dist/Forms/index.js +4 -0
- package/dist/Hyperlink/index.js +1 -0
- package/dist/ImageLink/ImageLink.js +1 -0
- package/dist/ImageLink/ImageLinkSet.js +1 -0
- package/dist/ImageLink/index.js +1 -0
- package/dist/Input/Input.js +3 -1
- package/dist/Insight/Featured/CategorySelector.js +1 -0
- package/dist/Insight/Featured/Featured.js +1 -0
- package/dist/Insight/Featured/Header.js +1 -0
- package/dist/Modal/Modal.js +1 -0
- package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
- package/dist/NavigationMenu/AxosALTS/index.js +1 -0
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
- package/dist/NavigationMenu/AxosBank/index.js +1 -0
- package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
- package/dist/NavigationMenu/LaVictoire/index.js +1 -0
- package/dist/NavigationMenu/NavDataJson.js +1 -0
- package/dist/NavigationMenu/Navbar.js +1 -0
- package/dist/NavigationMenu/SignInNavButton.js +1 -0
- package/dist/SetContainer/SetContainer.js +1 -0
- package/dist/SocialMediaBar/iconsRepository.js +1 -0
- package/dist/VideoTile/VideoTile.js +1 -0
- package/dist/VideoWrapper/index.js +1 -0
- package/dist/assets/Forms/HoneyPot/HoneyPot.css +4 -0
- package/dist/main.js +4 -0
- package/package.json +1 -1
package/dist/Forms/EmailUs.js
CHANGED
|
@@ -24,6 +24,7 @@ import clsx from "clsx";
|
|
|
24
24
|
import { useForm, FormProvider } from "react-hook-form";
|
|
25
25
|
import * as z from "zod";
|
|
26
26
|
import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
|
|
27
|
+
import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
|
|
27
28
|
const EmailUs = ({
|
|
28
29
|
icon = false,
|
|
29
30
|
children,
|
|
@@ -35,6 +36,7 @@ const EmailUs = ({
|
|
|
35
36
|
headline,
|
|
36
37
|
callToAction,
|
|
37
38
|
validateEmail,
|
|
39
|
+
onValidate,
|
|
38
40
|
description,
|
|
39
41
|
id
|
|
40
42
|
}) => {
|
|
@@ -42,8 +44,16 @@ const EmailUs = ({
|
|
|
42
44
|
email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
|
|
43
45
|
message: z.string().min(2, "Message is required")
|
|
44
46
|
});
|
|
47
|
+
const gen_schema = schema.merge(honeyPotSchema).superRefine((data, ctx) => {
|
|
48
|
+
if (!isValidHoneyPot(data)) {
|
|
49
|
+
ctx.addIssue({
|
|
50
|
+
code: z.ZodIssueCode.custom,
|
|
51
|
+
message: "fields are not valid."
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
45
55
|
const methods = useForm({
|
|
46
|
-
resolver: zodResolver(
|
|
56
|
+
resolver: zodResolver(gen_schema, {
|
|
47
57
|
async: true
|
|
48
58
|
}),
|
|
49
59
|
mode: "all",
|
|
@@ -77,59 +87,71 @@ const EmailUs = ({
|
|
|
77
87
|
}
|
|
78
88
|
)
|
|
79
89
|
] }),
|
|
80
|
-
/* @__PURE__ */ jsxs(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
/* @__PURE__ */ jsxs(
|
|
91
|
+
"form",
|
|
92
|
+
{
|
|
93
|
+
className: form,
|
|
94
|
+
onSubmit: async (e) => {
|
|
95
|
+
onValidate && onValidate(e);
|
|
96
|
+
await handleSubmit(submitForm)(e);
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant, formType: "email" })), children: [
|
|
101
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
102
|
+
Input,
|
|
103
|
+
{
|
|
104
|
+
id: "email",
|
|
105
|
+
...register("email", {
|
|
106
|
+
required: true,
|
|
107
|
+
validate: {
|
|
108
|
+
isValid: associatedEmail
|
|
109
|
+
}
|
|
110
|
+
}),
|
|
111
|
+
label: "Email",
|
|
112
|
+
sizes: "medium",
|
|
113
|
+
required: true,
|
|
114
|
+
error: !!errors.email,
|
|
115
|
+
helperText: errors.email?.message,
|
|
116
|
+
variant
|
|
90
117
|
}
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
disabled: !isValid || isSubmitting,
|
|
129
|
-
children: callToAction?.displayText
|
|
130
|
-
}
|
|
131
|
-
) })
|
|
132
|
-
] })
|
|
118
|
+
) }),
|
|
119
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
120
|
+
InputTextArea,
|
|
121
|
+
{
|
|
122
|
+
id: "message",
|
|
123
|
+
...register("message", { required: true }),
|
|
124
|
+
label: "Write Your Message",
|
|
125
|
+
sizes: "medium",
|
|
126
|
+
required: true,
|
|
127
|
+
error: !!errors.message,
|
|
128
|
+
helperText: errors.message?.message,
|
|
129
|
+
variant
|
|
130
|
+
}
|
|
131
|
+
) }),
|
|
132
|
+
/* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
|
|
133
|
+
] }),
|
|
134
|
+
children,
|
|
135
|
+
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
136
|
+
/* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
|
|
137
|
+
LoadingIndicator,
|
|
138
|
+
{
|
|
139
|
+
style: { marginInline: "auto" },
|
|
140
|
+
variant
|
|
141
|
+
}
|
|
142
|
+
) : /* @__PURE__ */ jsx(
|
|
143
|
+
Button,
|
|
144
|
+
{
|
|
145
|
+
color: getVariant(callToAction?.variant),
|
|
146
|
+
as: "button",
|
|
147
|
+
type: "submit",
|
|
148
|
+
disabled: !isValid || isSubmitting,
|
|
149
|
+
children: callToAction?.displayText
|
|
150
|
+
}
|
|
151
|
+
) })
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
)
|
|
133
155
|
] }) }) }, id);
|
|
134
156
|
};
|
|
135
157
|
export {
|
|
@@ -7,6 +7,9 @@ export interface FormProps extends PropsWithChildren {
|
|
|
7
7
|
onSubmit?: (values: {
|
|
8
8
|
[index: string]: string | boolean | number | Date | any;
|
|
9
9
|
}) => void;
|
|
10
|
+
onValidate?: (values: {
|
|
11
|
+
[index: string]: string | boolean | number | Date | any;
|
|
12
|
+
}) => void;
|
|
10
13
|
icon?: boolean;
|
|
11
14
|
headline?: ReactNode | string;
|
|
12
15
|
description?: ReactNode | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const h_container_position: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FieldErrors, UseFormRegister } from 'react-hook-form';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { FormProps } from '../FormProps';
|
|
4
|
+
|
|
5
|
+
export type HoneyPotInterface = {
|
|
6
|
+
Alternative_Phone?: string;
|
|
7
|
+
Alternative_Email?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const honeyPotSchema: z.ZodObject<{
|
|
10
|
+
Alternative_Email: z.ZodOptional<z.ZodString>;
|
|
11
|
+
Alternative_Phone: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
Alternative_Email?: string | undefined;
|
|
14
|
+
Alternative_Phone?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
Alternative_Email?: string | undefined;
|
|
17
|
+
Alternative_Phone?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const isValidHoneyPot: (data: HoneyPotInterface) => boolean;
|
|
20
|
+
export declare const HoneyPot: ({ variant: fullVariant, register, errors, }: {
|
|
21
|
+
variant?: FormProps["variant"];
|
|
22
|
+
register: UseFormRegister<any>;
|
|
23
|
+
errors: FieldErrors<HoneyPotInterface>;
|
|
24
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "../../Input/Checkbox.js";
|
|
3
|
+
import "../../Input/CurrencyInput.js";
|
|
4
|
+
import "../../Input/Dropdown.js";
|
|
5
|
+
import "../../Input/Dropdown.css.js";
|
|
6
|
+
import { Input } from "../../Input/Input.js";
|
|
7
|
+
import "../../Input/Input.css.js";
|
|
8
|
+
import "../../Input/InputAmount.js";
|
|
9
|
+
import { InputPhone } from "../../Input/InputPhone.js";
|
|
10
|
+
import "../../Input/InputTextArea.js";
|
|
11
|
+
import "../../Input/DownPaymentInput.js";
|
|
12
|
+
import "../../Input/RadioButton.js";
|
|
13
|
+
import "../../utils/allowedAxosDomains.js";
|
|
14
|
+
import { getVariant } from "../../utils/getVariant.js";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { h_container_position } from "./HoneyPot.css.js";
|
|
17
|
+
const honeyPotSchema = z.object({
|
|
18
|
+
Alternative_Email: z.string().optional(),
|
|
19
|
+
Alternative_Phone: z.string().optional()
|
|
20
|
+
});
|
|
21
|
+
const isValidHoneyPot = (data) => {
|
|
22
|
+
if (data.Alternative_Email !== "bestbank@axos.com" || data.Alternative_Phone !== "") {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
const HoneyPot = ({
|
|
28
|
+
variant: fullVariant = "primary",
|
|
29
|
+
register,
|
|
30
|
+
errors
|
|
31
|
+
}) => {
|
|
32
|
+
const variant = getVariant(fullVariant);
|
|
33
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: h_container_position, children: /* @__PURE__ */ jsx(
|
|
35
|
+
Input,
|
|
36
|
+
{
|
|
37
|
+
id: "Alternative_Email",
|
|
38
|
+
...register("Alternative_Email"),
|
|
39
|
+
label: "Alternative Email",
|
|
40
|
+
sizes: "medium",
|
|
41
|
+
error: !!errors.Alternative_Email,
|
|
42
|
+
helperText: errors.Alternative_Email?.message,
|
|
43
|
+
variant,
|
|
44
|
+
tabIndex: -1,
|
|
45
|
+
defaultValue: "bestbank@axos.com",
|
|
46
|
+
autoComplete: "false"
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: h_container_position, children: /* @__PURE__ */ jsx(
|
|
50
|
+
InputPhone,
|
|
51
|
+
{
|
|
52
|
+
id: "Alternative_Phone",
|
|
53
|
+
...register("Alternative_Phone", {
|
|
54
|
+
maxLength: 12
|
|
55
|
+
}),
|
|
56
|
+
label: "Alternative Phone",
|
|
57
|
+
sizes: "medium",
|
|
58
|
+
error: !!errors.Alternative_Phone,
|
|
59
|
+
helperText: errors.Alternative_Phone?.message,
|
|
60
|
+
variant,
|
|
61
|
+
tabIndex: -1,
|
|
62
|
+
autoComplete: "autocomplete_off_randString"
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
] });
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
HoneyPot,
|
|
69
|
+
honeyPotSchema,
|
|
70
|
+
isValidHoneyPot
|
|
71
|
+
};
|
|
@@ -19,7 +19,7 @@ export type MortgageRateInputs = {
|
|
|
19
19
|
loanPurpose: number;
|
|
20
20
|
[key: string]: string | number;
|
|
21
21
|
};
|
|
22
|
-
export declare const MortgageRate: ({ icon, children, onSubmit, disclosure, variant: fullVariant, validateEmail, id, rateWatchOnSubmit, setRateWatchSubmitted, hideModalValue, showingTables, }: FormProps & {
|
|
22
|
+
export declare const MortgageRate: ({ icon, children, onSubmit, disclosure, variant: fullVariant, validateEmail, id, rateWatchOnSubmit, setRateWatchSubmitted, hideModalValue, showingTables, onValidate, }: FormProps & {
|
|
23
23
|
rateWatchOnSubmit: (values: RateWatchInputs & {
|
|
24
24
|
email: string;
|
|
25
25
|
}) => Promise<void>;
|